On Mon, Dec 17, 2012 at 11:08 AM, Alex Baranosky
> wrote:
> Function values can't be read by the reader. I'm not sure how any
>> versions of this code work.
>>
>>
> It is true that a function value can not be printed and then read back in,
> but I don't think that's relevant here. The macro
On Mon, Dec 17, 2012 at 11:08 AM, Alex Baranosky <
alexander.barano...@gmail.com> wrote:
> Function values can't be read by the reader. I'm not sure how any
> versions of this code work.
>
>
It is true that a function value can not be printed and then read back in,
but I don't think that's releva
Function values can't be read by the reader. I'm not sure how any versions
of this code work.
On Mon, Dec 17, 2012 at 12:32 AM, Marko Topolnik
wrote:
> On Monday, December 17, 2012 9:28:20 AM UTC+1, bsmith.occs wrote:
>
>> Your macro:
>>
>> *(*~greeter user-name#*)*
>>
>> *
>> *
>>
>> I
On Monday, December 17, 2012 9:28:20 AM UTC+1, bsmith.occs wrote:
> Your macro:
>
> *(*~greeter user-name#*)*
>
> *
> *
>
> Is producing a list of a function or closure followed by a symbol. The
> first element of the list your macro builds must instead be an expression
> that can be ev
Your macro:
*(*~greeter user-name#*)*
*
*
Is producing a list of a function or closure followed by a symbol. The
first element of the list your macro builds must instead be an expression
that can be evaluated to a function. (For example a symbol naming a
function or an (fn [] ...) expre
On Sunday, December 16, 2012 9:57:26 PM UTC+2, Jonathan Fischer Friberg
wrote:
>
> I don't know why it doesn't work. However, changing defgreeter to the
> following seems work.
>
> (defmacro defgreeter [greeter-name]
> (let [greeter (make-greeter)]
> `(def ~greeter-name ~greeter)))
>
>
I think you are right, when ever the function returns a closure I get the
exception. I think it should work with closures anyhow.
--
-jarppe
On Sunday, December 16, 2012 7:49:30 PM UTC+2, juan.facorro wrote:
>
> I think it has to do with the closure in the *fn *used when generating
> the form
I don't know why it doesn't work. However, changing defgreeter to the
following seems work.
(defmacro defgreeter [greeter-name]
(let [greeter (make-greeter)]
`(def ~greeter-name ~greeter)))
Might be a clue. :)
Jonathan
On Sun, Dec 16, 2012 at 6:49 PM, juan.facorro wrote:
> I think it ha
I think it has to do with the closure in the *fn *used when generating the
form in the macro.
If you change this function:
*(defn make-greeter []*
* (let [message "hello"]*
*(fn [user-name]*
* (str message ", " user-name*
To this one:
*(defn make-greeter []
*
* (fn [user-name]*
Hi,
I have this macro (complete file https://www.refheap.com/paste/7633):
*(*defmacro defgreeter [greeter-name]
*(*let [greeter *(*make-greeter*)*]
`*(*do
*(*defn ~greeter-name [user-name#]
*(*~greeter user-name#*)**)**)**)**)*
It works as expected when make-greeter is
10 matches
Mail list logo