[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: here strings and symbols
> Sebastian Egner <sebastian.egner@xxxxxxxxxxx>
> > The background of the issue is the following: Sometimes I use
> > Scheme for 'rapid prototyping' in the following way---a program
> > that has no idea about Scheme, e.g. PostScript, externalizes
> > data in Scheme syntax. This data is then either read into a
> > Scheme program, or (and that is the tricky case) is directly
> > executed by a suitably primed Scheme interpreter. Now in the
> > latter case, it can be exremely convenient to reuse the identifiers
> > available in the substrate program (e.g. PostScript).
> Can you explain why it's convenient? (I'm sure you have a rationale,
> but I'm not sure which one of the several possibilities it is.)
The program producing the output is in the substrate
e.g. PostScript, and it is easiest if you can print
by adding something before and after, instead of doing
processing (the quoting). The substrate language might
very good at that.
> If you want to read the resulting code yourself, it seems kind of
> awkward to have:
> and so on. I'd personally rather have
> (define ps:foo (ps:baz))
> and resort to quoting or here strings only in the case of identifiers
> that defy direct translation to the "regular" identifier
> both quoting and here strings involve some kind of encoding---it's
> clear that any one is preferable, or even a translation to "regular"
> identifier syntax.
This exactly is my point: The example you gave is
awkward because the
'here identifiers' you use are multi-line. With one-liners
print the stuff like this:
(define |+ps:foo+| (|+ps:baz+|))