libera/#lisp - IRC Chatlog
Search
19:42:16
x8dcc
Now I am also thinking about my `define' function. It currently takes a symbol, which means it has to be quoted when calling it. Should I implement it as a "Special form" like `quote', or as a "wrapper"/macro that quotes the first argument?
19:50:07
aeth
a Lisp-style (define foo () bar) or Scheme-style (define (foo) bar) can assign (lambda () bar) to the global variable foo (if "Lisp-1", shared namespace) or the function name foo (if "Lisp-2", separate function and variable namespaces)
19:52:30
x8dcc
ieure: No, it doesn't have macros. I also have read some of that website but my project is very different. I don't want to use any external libraries and I use very different data structures.
19:53:37
x8dcc
Haven't even thought about macros yet, tbh. I might leave this "issue" for now and keep quoting the symbol. I still have a lot to add :)
19:58:19
aeth
just call it %define and keep quoting, then make your first macro define that exists to essentially unquote the quote as sugar
20:00:08
reb
x8dcc: If you look at Novig's Lisp interpreter you'll see that DEFINE is a special form, implemented directly in the eval procedure.
20:01:52
reb
Basically, whenever a form violates the standard evaluation rules, it needs to be handled specially somewhere, such as in eval ... or by a macro implementation.
21:22:08
x8dcc
For sure better than yesterday. I also bound eval and apply to the environment and it works fine https://dpaste.com/AE5DN477E