Live data from Hacker News

Learning Clojure: comparing with Java streams

blog.frankel.ch

41–46 of 46 posts

Re: Learning Clojure: comparing with Java streams

#41
post #40
post #39

Earlier quoted context omitted.

I think most schemes also don't have reader macros. How often do you actually use them in CL? I feel reader macros have the problem that it modifies/extend the foundational syntax. And that can become overloaded really quickly. Normal macros can change evaluation semantics, but not the fundamental syntax. Which makes it easier to navigate and understand in general. Also, reader macros are pretty hard to write in comp…

> I think most schemes also don't have reader macros. Scheme even has a fixed syntax in the RnRS reports. Lisp does not have that. > Also, reader macros are pretty hard to write in comparison. Not really. One just reads things from a stream and returns an s-expression. > I feel reader macros have the problem that it modifies/extend the foundational syntax That's a feature. The main purpose of user-written reader macr…

> Scheme even has a fixed syntax in the RnRS reports. Lisp does not have that.

Could you link to the RnRS in question? I'm curious.

> Not really. One just reads things from a stream and returns an s-expression.

I feel like if I agree to this, I also agree that pre-processors are easy to write and use. And that undermines the innovation and superiority of syntactic macros introduced by Lisp.

> The main purpose of user-written reader macros is to extend S-expressions to support literal syntax of new user-defined data types.

This is possible in Clojure as well. You can extend the language with new data literals. But they must begin with # + char(s) and respect the existing reader semantics, as they are processed as a syntactic macro, and not a lexical one. So you could add #queue[1 2 3] for example. But you couldn't add |1 2 3|

> On my Lisp Machine it was actually useful.

If only they'd still make those, and had improved its performance.

Re: Learning Clojure: comparing with Java streams

#42
post #41
post #40

Earlier quoted context omitted.

> I think most schemes also don't have reader macros. Scheme even has a fixed syntax in the RnRS reports. Lisp does not have that. > Also, reader macros are pretty hard to write in comparison. Not really. One just reads things from a stream and returns an s-expression. > I feel reader macros have the problem that it modifies/extend the foundational syntax That's a feature. The main purpose of user-written reader macr…

> Scheme even has a fixed syntax in the RnRS reports. Lisp does not have that. Could you link to the RnRS in question? I'm curious. > Not really. One just reads things from a stream and returns an s-expression. I feel like if I agree to this, I also agree that pre-processors are easy to write and use. And that undermines the innovation and superiority of syntactic macros introduced by Lisp. > The main purpose of user…

> Scheme even has a fixed syntax in the RnRS reports. Lisp does not have that.

https://schemers.org/Documents/Standards/R5RS/HTML/r5rs-Z-H-...

> And that undermines the innovation and superiority of syntactic macros introduced by Lisp.

They have a different purpose and operate on a different level.

> respect the existing reader semantics

This is an example of xapping data structure in *Lisp for for the Connection Machine

{moe->"Oh, a wise guy, eh?" larry->"Hey, what's the idea?" curly->"Nyuk, nyuk, nyuk!"}

> If only they'd still make those, and had improved its performance

Nowadays it might be easier to use an emulator running the OS.

Re: Learning Clojure: comparing with Java streams

#43
post #42
post #41

Earlier quoted context omitted.

> Scheme even has a fixed syntax in the RnRS reports. Lisp does not have that. Could you link to the RnRS in question? I'm curious. > Not really. One just reads things from a stream and returns an s-expression. I feel like if I agree to this, I also agree that pre-processors are easy to write and use. And that undermines the innovation and superiority of syntactic macros introduced by Lisp. > The main purpose of user…

> Scheme even has a fixed syntax in the RnRS reports. Lisp does not have that. https://schemers.org/Documents/Standards/R5RS/HTML/r5rs-Z-H-... > And that undermines the innovation and superiority of syntactic macros introduced by Lisp. They have a different purpose and operate on a different level. > respect the existing reader semantics This is an example of xapping data structure in *Lisp for for the Connection Mac…

> https://schemers.org/Documents/Standards/R5RS/HTML/r5rs-Z-H-...

Sorry, maybe I'm not seeing it, but what part of that link describe lexical user definable reader macros in scheme?

> {moe->"Oh, a wise guy, eh?" larry->"Hey, what's the idea?" curly->"Nyuk, nyuk, nyuk!"}

Right, so in Clojure you could extend the reader and do:

#xapping{moe "Oh, a wise guy, eh?" larry "Hey, what's the idea?" curly "Nyuk, nyuk, nyuk!"}

As a data literal for xapping data structures.

Re: Learning Clojure: comparing with Java streams

#44
post #43
post #42

Earlier quoted context omitted.

> Scheme even has a fixed syntax in the RnRS reports. Lisp does not have that. https://schemers.org/Documents/Standards/R5RS/HTML/r5rs-Z-H-... > And that undermines the innovation and superiority of syntactic macros introduced by Lisp. They have a different purpose and operate on a different level. > respect the existing reader semantics This is an example of xapping data structure in *Lisp for for the Connection Mac…

> https://schemers.org/Documents/Standards/R5RS/HTML/r5rs-Z-H-... Sorry, maybe I'm not seeing it, but what part of that link describe lexical user definable reader macros in scheme? > {moe->"Oh, a wise guy, eh?" larry->"Hey, what's the idea?" curly->"Nyuk, nyuk, nyuk!"} Right, so in Clojure you could extend the reader and do: #xapping{moe "Oh, a wise guy, eh?" larry "Hey, what's the idea?" curly "Nyuk, nyuk, nyuk!"}…

> Sorry, maybe I'm not seeing it, but what part of that link describe lexical user definable reader macros in scheme?

None. I never said it does. I said it has a fixed syntax.

Re: Learning Clojure: comparing with Java streams

#45
post #44
post #43

Earlier quoted context omitted.

> https://schemers.org/Documents/Standards/R5RS/HTML/r5rs-Z-H-... Sorry, maybe I'm not seeing it, but what part of that link describe lexical user definable reader macros in scheme? > {moe->"Oh, a wise guy, eh?" larry->"Hey, what's the idea?" curly->"Nyuk, nyuk, nyuk!"} Right, so in Clojure you could extend the reader and do: #xapping{moe "Oh, a wise guy, eh?" larry "Hey, what's the idea?" curly "Nyuk, nyuk, nyuk!"}…

> Sorry, maybe I'm not seeing it, but what part of that link describe lexical user definable reader macros in scheme? None. I never said it does. I said it has a fixed syntax.

Oh I see. Okay I misunderstood you.

What do you mean by fixed syntax? A formal syntax?

Re: Learning Clojure: comparing with Java streams

#46
post #31

Not a lot of comments here for the number of upvotes, but the trend of the comments strikes me as lopsidedly negative and I'd like to throw in something positive to the mix - Clojure needs more people publishing beginner friendly code even if it isn't using some specific function that does the same thing with less typing. So, y'know, I'm really glad we've got people out there who are documenting how they manage to ge…

Author here. Many thanks for your encouragements!

Actually, I didn't feel any comments were particularly harsh. I'm learning from most of them. This is exactly the feedback I'm searching for: idiomatic Clojure.

Post reply on HN