[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Interpret #r"..." as a raw string

From: Daniel Brooks
Subject: Re: [PATCH] Interpret #r"..." as a raw string
Date: Tue, 02 Mar 2021 22:14:52 -0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)

Richard Stallman <rms@gnu.org> writes:

>   > I have seen it called a "raw string literal" in other languages.
> The concept of "literal" does not fit Lisp very well.  It describe the
> situation with other languages, where expressions are not objects,
> only syntax.  In those languages, you don't put a string into your
> program, only a "literal" which represents a string value.
> In Lisp, what you put in the program _is_ a string.  What you write
> in the textual code is not a "literal", it is the textual representation
> of the string to put in the program.
> I just saw that the term "literal" appears occasionally in the Emacs
> Lisp Ref Manual.  Would someone like to rewrite those parts so that they
> fit the concepts of Lisp batter?

Are you sure? I could be wrong, but I think that the idea of literals
for types other than just numbers and strings comes from Lisp.

For example, if Javascript didn't have array literals then code like
this would be common:

    var foo = new Array();
    foo[0] = 42;
    foo[1] = 24;

Compare that with "var foo = [42, 24]" and "(setq foo '(42 24))".

I've not written much Pascal, but in section 19 of TeX: The Program we
see an array declared:

    xchr: array [ASCII_code] of text_char;

Followed by initialization in section 20:

    xchr[’40] ← ' ';
    xchr[’41] ← '!';
    xchr[’42] ← '"';

and so on.

But the terminology is something that probably doesn't come from Lisp,
since Lisp doesn't make any distinction between a list used for data and
a list used for code.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]