Thanks for pointing my error out. I was not only oversimplifying things,
worse, I simplified something away that was crucial to the original
question.
Regards
Stefan
--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email
2011/11/2 Stefan Kamphausen ska2...@googlemail.com:
Hi,
while all the other answers already offered explanations and solutions I
feel like I should add, that macros like - and - work on the
source-code.
Not quite. Macros work on Clojure data structures returned by the
Clojure Reader (so
As a nice result of this, you can easily see what the problem is
simply by quoting the form: this resolves reader macros but leaves the
form otherwise unevaluated, so you can determine what forms the -
macro is working with:
user '(- x #(inc %))
(- x (fn* [p1__4781#] (inc p1__4781#)))
user
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
hi there,
i stumbled over two odd things
1) - and - have the same source code. why is that?
2) why can't i use (- hi #(println %)) directly? why do i have to
put my function into a symbol first? is there a way to avoid this?
(let [dummy #(println
On Wednesday, November 2, 2011 11:37:32 AM UTC+2, HamsterofDeath wrote:
hi there,
i stumbled over two odd things
1) - and - have the same source code. why is that?
Similar, but not the same [1]:
(~(first form) ~x ~@(next form)) vs. (~(first form) ~@(next form) ~x)
2) why can't i use (-
i stumbled over two odd things
1) - and - have the same source code. why is that?
The source code is _not_ the same for the two macros you mentioned. I
will leave it to you to spot the differences ;-)
2) why can't i use (- hi #(println %)) directly? why do i have to
put my function into a
...@googlemail.com
To: clojure@googlegroups.com
Sent: Wednesday, November 2, 2011 4:37 AM
Subject: - vs - and names vs anonymous function
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
hi there,
i stumbled over two odd things
1) - and - have the same source code. why is that?
2) why can't i use (- hi #(println
On Wed, Nov 2, 2011 at 5:37 AM, Dennis Haupt d.haup...@googlemail.com wrote:
i stumbled over two odd things
1) - and - have the same source code. why is that?
- and - are macros that have similar purposes. - inserts the previous form
as the first argument to the function, - inserts it as the
Hi,
while all the other answers already offered explanations and solutions I
feel like I should add, that macros like - and - work on the
source-code. So using - does not mean 'pass the first thing as an
argument to the function call in the second thing', it means 'take the
first thing and
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
thx
*note: use macroexpand next time*
Am 02.11.2011 10:58, schrieb Jonas:
On Wednesday, November 2, 2011 11:37:32 AM UTC+2, HamsterofDeath
wrote:
hi there,
i stumbled over two odd things 1) - and - have the same source
code. why is that?
On Wed, Nov 2, 2011 at 6:12 AM, Dennis Haupt d.haup...@googlemail.com wrote:
so - and - behave the same as long as my functions only take one
parameter?
They do if you avoid inline function definitions.
--
You received this message because you are subscribed to the Google
Groups Clojure
11 matches
Mail list logo