On Wed, Nov 4, 2009 at 1:10 PM, Brian Hurt <[email protected]> wrote:
> Or am I just stupid and using definline wrong?  I started experimenting with
> definline today, and don't seem to be able to make it work:
>
>
>> $ ./repl
>> Clojure 1.1.0-alpha-SNAPSHOT
>> user=> (definline foo [ x ] (+ x 1))
>> java.lang.ClassCastException: clojure.lang.Symbol cannot be cast to
>> java.lang.Number (NO_SOURCE_FILE:0)
>> user=>

definline is more like defmacro than it is like defn

user=> (definline foo [x] `(+ ~x 1))
#'user/foo
user=> (foo 5)
6
user=> (map foo [2 5 10])
(3 6 11)

--Chouser

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to