4 ms·
Only got one comment but this article was also posted a week ago - https://news.ycombinator.com/item?id=11541170 https://news.ycombinator.com/item?id=11541170
by draegtun 10y ago
Only got one comment but this article was also posted a week ago - https://news.ycombinator.com/item?id=11541170 https://news.ycombinator.com/item?id=11541170
- vanderZwan 10y agoAh, must have missed it. Maybe if we let this one up it might attract more discussion a second time? I posted it hoping that some fanatic Lispers had some interesting thoughts to add.
- draegtun 10y agoYes the article deserves more attention so hopefully it will get much more eyeballs this time round :)
- junke 10y agoI am not fanatic and I liked this article because I don't know Rebol very much. Rebols quoted code and "use" remind me a little of "uplevel" in Tcl. I don't see a use case where I would like eval to capture the lexical environment. If I need to provide bindings, just define them explicitely: (eval `(let ((msg "Hello")) ,code)) ... or use special variables. Alternatively, (define-symbol-macro msg "Hello") could work too, but that would be ugly.
- aidenn0 10y agoSemi-fanatic lisper here. First of all, search the other comments for a discussion of f-exprs. I was not familiar with Rebol before this article, but this author shows a very good understanding of metaprogramming and homoiconicity, if they picked up this much about lisp macros without having used lisp previously. Something that throws a lot of people new to common lisp is that macros are so powerful that they seem like magic, when they are probably the simplest metaprogramming tool around. In fact a big part of why I find CL to be such a high local maxima is the very high power/complexity ratio. Complicated metaprogramming techniques tend to have either high compile-time overhead, high run-time overhead, or both. Sometimes efficient implementations can be discovered with the application of a large number of PhDs. Lastly, I want to point out that bolting on a full-code walker to Common Lisp is not possible to do in a fully portable way (and by "fully portable" I mean "will run on any future conformant CL implementation"). This is due to the fact that conforming implementations are allowed to expand macros (and even special forms) from the standard into code that contains non-standard symbols. Obviously you can do code walkers that are portable across N existing implementations with O(N) amount of programming effort; see cl-cont[1] for an example of this. On the other hand, it would be very doable (if not quite trivial) to implement something in CLOS that works like a code-carrying closure that allows recompilation with declarative scope. I do sometimes miss the fact that EVAL doesn't take an environment. The upside is that judging by questions I've seen in #lisp, if it did have such a construct, there would be a lot of fairly spaghetti-like EVAL code when a two-line macro would do the trick, as EVAL is the more obvious tool for code-as-data when macros are simpler and easier to understand. 1: http://quickdocs.org/cl-cont/api http://quickdocs.org/cl-cont/api
- dang 10y agoReposts are fine if a story hasn't had attention yet, and it's stories like this that that rule exists for. https://news.ycombinator.com/newsfaq.html https://news.ycombinator.com/newsfaq.html