Re: is this macro right?

2015-12-28 Thread Mian Pao
Sorry, because i ask the first question which i can't find it.I'm sorry for 
that.

On Tuesday, December 29, 2015 at 4:50:57 AM UTC+8, Leif wrote:
>
> I tried to answer this on your other thread.  If it was unclear, please 
> tell me (on that thread) what points need to be clarified, and I'll try my 
> best.  I am unsure why you started a new thread asking the same question, 
> with even less context.
>
> --Leif
>
> On Monday, December 28, 2015 at 3:47:39 AM UTC-5, Mian Pao wrote:
>>
>>
>> http://stackoverflow.com/questions/34448773/is-function-print-has-bug-in-clojure
>>
>

-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


is this macro right?

2015-12-28 Thread Mian Pao
http://stackoverflow.com/questions/34448773/is-function-print-has-bug-in-clojure

-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: is it function print has bug?

2015-12-28 Thread Mian Pao
Thanks for answer my question.

On Saturday, December 26, 2015 at 10:59:51 PM UTC+8, Leif wrote:
>
> Hi, Mian Pao.
>
> When you call the macro te, a is bound to the *symbol* 'print, not the 
> *function* print.  So, what the ~(a b c) form is doing is calling the 
> symbol 'print as a function:
> ('print 1 '(2 3)) => '(2 3)
>
> This is because symbols and keywords implement the function interface, and 
> the call above is equivalent to 
> (get 1 'print '(2 3)) => '(2 3) ; Tries to look up 'print in the data 
> structure 1, fails, uses default value '(2 3).
>
> Hope that helps,
> Leif
>
> On Thursday, December 24, 2015 at 8:38:44 AM UTC-5, Mian Pao wrote:
>>
>> I just write a macro
>>
>> ```
>> (defmacro te
>>   [a b & c]
>>   `(print
>>  ~(a b c)))
>> ```
>>
>> and i run
>>
>> ```
>> (macroexpand '(te print 2 3 4))
>> ;=> (clojure.core/print (3 4))
>> ```
>>
>> it get `(clojure.core/print (3 4))` not `(clojure.core/print nil)`
>>
>> iti is mean `(print 2 '(3 4))` return (3 4)?
>>
>

-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


is it function print has bug?

2015-12-24 Thread Mian Pao
I just write a macro

```
(defmacro te
  [a b & c]
  `(print
 ~(a b c)))
```

and i run

```
(macroexpand '(te print 2 3 4))
;=> (clojure.core/print (3 4))
```

it get `(clojure.core/print (3 4))` not `(clojure.core/print nil)`

iti is mean `(print 2 '(3 4))` return (3 4)?

-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.