4 ms·
All I know is that in Python, JS and Clojure is I’ve accidentally written code like: def foo(str): v = str(1) . . . Which resulted in head-scr
by fiddlerwoaroof 5y ago
All I know is that in Python, JS and Clojure is I’ve accidentally written code like:
def foo(str):
v = str(1)
. . .
Which resulted in head-scratching errors like “str is not a function”.
EDIT: I agree that hygienic macros aren't the right way to solve this issue.
- louai 5y agoWith Lisp-2 designs as discussed in the article this is not an issue, as variables and functions are in different namespaces: CL-USER> (defun foo (list) (list list)) FOO CL-USER> (foo 42) (42) In this case the function attached to the symbol LIST is applied to the argument with the same name, but that isn't a problem. To further illustrate, in the above example the LIST symbol is imported from the package COMMON-LISP and has a function, plist etc. attached to it: CL-USER> (symbol-package 'list) #<PACKAGE "COMMON-LISP"> CL-USER> (symbol-function 'list) #<FUNCTION LIST> CL-USER> (symbol-plist 'list) NIL
- fiddlerwoaroof 5y agoYeah, I’ve been writing Common Lisp for six years now: Lisp-2s, IMO, make the right trade-offs
- kazinator 5y agoMacros don't appear in your code example, so they cannot solve anything.