"Sina K. Heshmati" <s...@khakbaz.com> said: > "alux" <alu...@googlemail.com> said: > >> I got a very basic question about the concept of "special form". What >> is correct, multiple selections allowed: >> >> [ ] A special form is what can be implemented by a macro. > > Wrong. Macros cannot remove the need for special-forms, at least not in a real > interpreter. In a metacircular implementation, you can replace special-forms > with > calls to the base-level implementation. For instance, if you evaluate 'if' at > base-level, then you can use it to define 'cond' at base-level.
Oh, I meant: ... then you can use it to define 'cond' at *meta*-level. >> [ ] Every macro gives a special form. > > They can all be reduced to a number of expressions that cannot be implemented > by > neither macros nor functions. > > These expressions can be evaluated using normal functions if you have lazy > evaluation of arguments. So, if you have lazy-eval, there's no need for > special-forms. > >> [ ] Only a macro that doesn't evaluate some of its arguments gives a >> special form. > > You could say that. > >> [ ] A special form is always built in, and cannot be implemented in >> the language itself. > > Unless you have lazy-eval. > >> [ ] Special forms are exactly the things that can be called, but dont >> evaluate all of their arguments. (Macros and build-ins, at least for >> eager languages.) >> >> [ ] The concept of special form doesnt have anything to do with >> eagerness or lazyness. > > Wrong. It has everything to do with laziness. If you have one, you don't need > the > other. > > Please note that, the concept of special-forms is a compromise and I don't > think > anyone would want to have them. A language designer has to make a choice as to > whether to have special forms or not. If they don't want special-forms, then > they > should provide lazy evaluation of arguments. > > Some introduce functional parameters in order to provide lazy evaluation of > arguments but that choice has its own trade-offs since it introduces a kind of > dynamic scoping. > > Kind regards, > SinDoc -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en