News for hackers. Stuff that matters.
Re:Mark – A simple and unified notation for both object and ... by nanny on Monday February 05, 2018 @04:07PM (#16312196)
And then CLOS objects, hash tables, regular expressions, etc. can be added with reader macros.
Re:Mark – A simple and unified notation for both object and ... by TeMPOraL on Monday February 05, 2018 @05:18PM (#16312770)
It's cool and I love it, but it's irrelevant in the context of a universal data exchange language. In such case, you'd want to have those primitives defined in the exchange language spec itself - even if you'd end up implementing them as reader macros in CL (which I don't recommend - reader macros turn your READs into EVALs, which you obviously shouldn't do on untrusted input).
Re:Mark – A simple and unified notation for both object and ... by zeveb on Monday February 05, 2018 @06:39PM (#16313285)
> you'd want to have those primitives defined in the exchange language spec itself

I agree with this: certain things need to be in the spec.

> even if you'd end up implementing them as reader macros in CL (which I don't recommend - reader macros turn your READs into EVALs, which you obviously shouldn't do on untrusted input).

This I don't agree with, because technically #\( & #\" are reader macros … they're just very well-defined reader macros. Presumably a spec which defined hash tables, regular expressions or whatever would define them as well as the Lisp spec defines lists and strings (and if not, well — it's a bad spec!).

Re:Mark – A simple and unified notation for both object and ... by TeMPOraL on Monday February 05, 2018 @06:57PM (#16313374)
> I agree with this: certain things need to be in the spec.

That was my main point. In the second part of the comment I didn't mean to discourage use of reader macros - it was more of an aside that the general facility of CL-style reader macros literally makes READ "shell out" into EVAL, so you need to (diligently) disable it for untrusted input (or reimplement a limited READ by hand). So we can't say "oh, but S-exps in Common Lisp can have anything through reader macros". Presumably if hash table literals were specified as a part of basic syntax, we could depend on it being standard and part of the safe subset of READ's duties; as it is however, we can't depend on it for arbitrary inputs.