6 ms·
Common Lisp could evolve into totally parenthesis-free language. By expanding the "powerfull and versatile" Loop-macro into full powerfullness and versatileness
by timonoko 6y ago
Common Lisp could evolve into totally parenthesis-free language. By expanding the "powerfull and versatile" Loop-macro into full powerfullness and versatileness. Unfortunately two parenthessis needed, but you can redefine the language having those by default around every file.
- ashtonkem 6y agoIt was originally supposed to, s-expressions (parenthesis) were supposed to be eventually replaced with m-expressions which were influenced by Algol and FORTRAN (the irony), but reviewers of the paper and the initial implementors of lisp preferred s-expressions, which stuck. That being said, having worked professionally in Lisp, the “un-lispy” macros like Loop are some of the worst parts of that language. They completely violate the otherwise standard-ish syntax of Lisp, are very poorly documented, impossible to memorize, and are really hard to debug despite the otherwise excellent tooling available for top tier implementations like SBCL. It was our standard practice to replace these macros with more verbose but idiomatic lisp whenever possible.
- andi999 6y agohow would an idiomatic loop statement look like?
- sfrank 6y agoLike iterate (https://common-lisp.net/project/iterate/ https://common-lisp.net/project/iterate/)
- bjoli 6y agoIterate is more lispy, and for people that don't like macros transversing the loop body (because the errors you get when something like that goes wrong are hard to debug), something like foof-loop for scheme is pretty nice. I am writing this on neanderthal GPRS internet, so I leave finding documentation for these looping facilities an exercise for the reader.
- deleted 6y ago[deleted]
- timonoko 6y agoJust a jumble of random words. They are especially difficult to non-english speakers, because they are not grammatically correct sentences, but rely on some unknown word-order logic in indo-european languages. Same aplies to list comprehension sentences in Python too.
- andi999 6y agoCan you elaborate? I have difficulties understanding what you mean. Do you really mean an idiomatic loop should be 'a jumble of random words'?
- timonoko 6y agoDifficult to explain cause not an expert, but most languages do not have "list comprehension" by post-description. "New York has rats bigger than a dog" comes to mind. In Finnish you can but the adjective word have same ending or grammatical case as the main word. Without those clues the sentence would be nonsensical.
- shakow 6y ago> but most languages do not have "list comprehension" by post-description. "New York has rats bigger than a dog" comes to mind. « New-York a des rats plus gros que des chiens »
- timonoko 6y agoThat is an indo-european language. Those languages have no grammar or rules. You just string words together and hope it makes sense.
- shakow 6y ago> You just string words together and hope it makes sense. I beg your pardon? Messing the word orders in French or German will definitely mess up the sentence. The German would be something like “Im New York sind Ratten, die größter als Hunden sind”, and moving the words would make the sentence invalid – albeit probably understandable.
- vindarel 6y agoRecipes here: https://lispcookbook.github.io/cl-cookbook/iteration.html https://lispcookbook.github.io/cl-cookbook/iteration.html
- Rerarom 6y ago"Haskell is Lisp's missing M-Expression implementation."
- deleted 6y ago[deleted]
- goto11 6y agoParentheses in Lisp is like significant whitespace in Python: A big stumbling block for people who don't use the language.
- kgwgk 6y agoBut for those who use the language one is a powerful feature and the other a minor annoyance.
- agumonkey 6y agoI don't even remember when parens stopped being an issue. I think my hate relationship toward algol syntax was so strong, sexp were an obvious answer from minute 0.
- iambrj 6y agoOne man's hack is another man's elegance
- Insanity 6y agoThe parens made me reluctant to try lisp. Then, 5ish years ago I decided to "just do it", and now they don't bother me at all. The experience of a beginner is also important though, especially for language adoption, this might be one of the reasons why lisp flavours are not more popular.
- konjin 6y agoA lisp without brackets is no longer a lisp.
- adamkl 6y agoHeck, why not just go one (several?) steps further and just use macros to create a DSL for <insert your favourite language here>? https://aphyr.com/posts/353-rewriting-the-technical-interview https://aphyr.com/posts/353-rewriting-the-technical-intervie...