AbandonedSince infogami has been abandoned by its creators, I’m out too. Back to web.fisher.cx for me. Everything that was here is there. Robert FisherJust thinking out loud On prefix notationIf you register and log in you can add comments to my pages. If viewing the main blog page, click the # underneath an entry to comment on it. Some claim that the prefix notation is a barrier to success for Lisp. Consider the following C code:
It's almost entirely prefix notation. The exceptions are the greater-than (>), assignment operator (=), & the logical-or operator (||). Array access ([]) doesn't really fit into the prefix/infix/postfix taxonomy. Neither do the declarations:
(A pendant could also mention that the comma operator is also infix instead of prefix, but that's picking nits.) So, C is really prefix notation syntax with a bit of infix syntax for a limited set of operators. In Scheme (or Common Lisp) you can easily create a macro that allows you to use infix notation & have a situation not so different from C. Here's an macro that implements (a simple, no precedence) infix syntax that took me about 10 minutes to write.
This allows me to say things such as:
...which evaluates to 25. I can use it with boolean operators as well:
(If I use this a lot, I may need to see if I can make a read macro to make it a bit less verbose.) Prefix notation also matches English imperatives.
last updated 2 years ago # |