3 ms·
In a lisp-1, you name your list variables lst. In a lisp-2, they are called list.
by rags2riches 7y ago
In a lisp-1, you name your list variables lst. In a lisp-2, they are called list.
- owl57 7y agoNot sure if that's a good example. My lists of foos are usually named "foos", not "list" or "lst".
- bjoli 7y agoI come from a scheme tradition where higher order functions are used for many things. I often use the name lst for generic lists. I am not so sure I think it matters. In the place where it matters the most (macros) scheme has macro hygiene. That discussion is not worth having here though, because it is really just a matter of taste. I like both ways, but prefer the scheme way where you have to explicitly break hygiene instead of explicitly try to not shadow bindings . I understand that defmacro can be nice sometimes, and for that most schemes provide it (heck, even racket has it!).
- owl57 7y agoNow that I think of it, I certainly have tripped on "list" arguments in Python, but adopted haskellers' "xs" for such generic uses and forgot about it. BTW, GHC throws especially funny messages when you define a variable like "head" or "last" and then try to call the shadowed function. OTOH, Emacs' python-mode highlights builtins regardless of context, very convenient to catch such lapses immediately.