Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Porting Common Lisp's feature expressions to Clojure(Script)

144 views
Skip to first unread message

r0man

unread,
Jul 27, 2012, 8:28:46 PM7/27/12
to
Hello Common Lisper's,

the Clojure Community is discussing right now the implementation
of Common Lisp's feature expressions (a.k.a. *features*, #+ and
#-) [1,2]. The goal is to allow branching of forms that require
special handling on different implementations of Clojure (in this
case, Clojure and ClojureScript).

Since I know this feature only from books (i'm new to Lisp) I
would like to gather some feedback from the Common Lisp
community.

* Do you know about anything that you missed in Common Lisp's
aproach?

* Did you had any problems with such a feature beeing implemented
at the reader level?

* Should this better be implemented as a macro?

* Anything to consider we haven't thought of yet?

Thank you, Roman.

[1] http://dev.clojure.org/jira/browse/CLJS-27
[2] http://dev.clojure.org/display/design/Feature+Expressions
[3] https://groups.google.com/forum/?hl=en&fromgroups#!topic/clojure-dev/LH8-1pui0H0

Elias Mårtenson

unread,
Jul 27, 2012, 9:54:39 PM7/27/12
to
I can address one of the quest, whether they are better implemented as a macro. The answer to this is clearly no. In fact, it couldn't be implemented as a macro, because at the time the macro is evaluated, the symbols making up the expression has already been interned by the reader. Thus, if the form references any packages that does not exist in your environment, you would get an error in the reader, before your conditional expression has had the chance to run.
0 new messages