7 ms·
Other than `@case`, are there other examples of macropy macros?? @case means nothing to me.
by nubela 6y ago
Other than `@case`, are there other examples of macropy macros?? @case means nothing to me.
- carver 6y agoTail call optimization is appealing. Sometimes recursion is the cleanest implementation, but call depth is not known up front.
- lihaoyi 6y agoThe page has links to a dozen different examples, with code snippets and discussion of the motivations and potential use cases for each
- sitkack 6y agoTotally off topic, but I was wondering if you have looked at Coconut, a kind of ML Lite that compiles to Python? And if so, what do you think? http://coconut-lang.org/ http://coconut-lang.org/ Are you still mainly programming in Scala? Do you see yourself programming in your current language in 5 years?
- anentropic 6y agoThis project is great Would love to see a new release on PyPI that works with Python > 3.4 ;) (last release seems to be "1.1b2" in 2018...)
- memco 6y agoI’m having a hard time understanding what advantages @case has over data classes.
- lihaoyi 6y agoThe main reason @case is an example macro is that data classes did not exist when this project was conceived
- deleted 6y ago[deleted]
- dhash 6y agoLihaoyi mostly authors scala libraries. I switched from python to scala and found many of the things that I love about scala ported to python with this library. Case classes (pretty .toString, structural equality, .copy, and destructuring), Scala 3-esque enums, f-string interpolations before python added them, pattern matching, and _ based lambdas are the highlights for me.