• quote

    From none) (albert@21:1/5 to All on Fri Apr 29 11:54:25 2022
    What with the superfluous parentheses with quote ?

    Why
    (quote (a b c ))

    in stead of

    (quote a b c ) ?

    After all quote is a special function, it decides for itself
    whether the arguments are evaluated.

    Groetjes Albert
    --
    "in our communism country Viet Nam, people are forced to be
    alive and in the western country like US, people are free to
    die from Covid 19 lol" duc ha
    albert@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Siebe de Vos@21:1/5 to albert on Fri Apr 29 12:35:57 2022
    On 29/04/2022 11.54, albert wrote:
    What with the superfluous parentheses with quote ?

    Why
    (quote (a b c ))

    in stead of

    (quote a b c ) ?

    After all quote is a special function, it decides for itself
    whether the arguments are evaluated.

    Groetjes Albert

    What does (quote a) mean in your proposal:

    'a

    or

    '(a)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From none) (albert@21:1/5 to siebe@de-vos.de on Fri Apr 29 13:37:27 2022
    In article <t4gf2d$17mo$1@gioia.aioe.org>,
    Siebe de Vos <siebe@de-vos.de> wrote:
    On 29/04/2022 11.54, albert wrote:
    What with the superfluous parentheses with quote ?

    Why
    (quote (a b c ))

    in stead of

    (quote a b c ) ?

    After all quote is a special function, it decides for itself
    whether the arguments are evaluated.

    Groetjes Albert

    What does (quote a) mean in your proposal:

    'a

    or

    '(a)

    You implicitly answered the question.
    There would be no distinction between
    (quote a) and (quote (a)) and I can see
    that this is necessary.

    Groetjes Albert
    --
    "in our communism country Viet Nam, people are forced to be
    alive and in the western country like US, people are free to
    die from Covid 19 lol" duc ha
    albert@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kaz Kylheku@21:1/5 to albert@cherry on Fri Apr 29 19:15:32 2022
    On 2022-04-29, albert@cherry.(none) (albert) <albert@cherry> wrote:
    What with the superfluous parentheses with quote ?

    Why
    (quote (a b c ))

    in stead of

    (quote a b c ) ?

    After all quote is a special function, it decides for itself
    whether the arguments are evaluated.

    Hi Albert.

    The syntax of quote is actually

    (quote expression)

    The extra level of list nesting there comes from the expression being a compound:

    (quote (list 1 2 3)) -> (list 1 2 3)

    It doesn't have to be a compound:

    (quote a) -> a ;; quote a symbol

    Given that expression can be anything, it follows that quote must
    support (quote (a b c)).

    So there is the possibility that quote could *also* support
    (quote a b c) as a shorthand for (quote (a b c)).

    But that would only complicate every single situation in which a piece
    of syntax must be analyzed; both representations would have to be
    handled.

    So then we could also think about banishing (quote (a b c)) and
    requiring it that the representation of that must be (quote a b c). But
    then, because lists can sometimes be one element long, what do you do
    with (quote (a))? If that is required to be written (quote a), then you
    have confusion with quoting a symbol.

    Then there are other considerations. Consider the backquote.

    What if you have this:

    `(.... (quote ,@splice))

    If the splice variable happens to contain the list (a), we get
    (quote a), which means quote the a symbol.
    If it contains (a b c) we get (quote a b c), which means
    (quote (a b c)). Yikes; the shape of the run-time value being spliced determines the meaning of the code being generated.

    Currentg backquote implementations will diagnose the istuation
    when two or more elements are spliced into quote form.
    If you have splice under a quote:

    ',@splice
    (quote ,@splice)

    and splice does not evaluate to a list of exactly one elements, the
    backquote implementation will somehow diagnose it. (Possibly
    by just generating the bad quote and letting the quote operator
    diagnose it, or by itself recognizing the bad quote, since
    the backquote expander does have to walk and understand quotes.)

    Lastly, there is no utility whatsoever in trying to reduce the
    list shape of the quote syntax to a less nested form, because
    there is already a read syntax which hides it: '(a b c)!

    Quotes disappear at compile time. Extra nesting in a bit of
    compile-time syntax is nothing.

    Cheers!

    --
    TXR Programming Language: http://nongnu.org/txr
    Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Stefan Monnier@21:1/5 to need to on Fri Apr 29 16:46:29 2022
    The syntax of quote is actually

    (quote expression)

    Of course, it could have been

    (quote . <expression>)

    so that (quote a b c) indeed returns the value (a b c), but then you'd
    need to write (quote . 42) to return the value 42.

    Quotes disappear at compile time. Extra nesting in a bit of
    compile-time syntax is nothing.

    Indeed,


    Stefan

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From steve g@21:1/5 to none on Mon Oct 24 17:53:58 2022
    none wrote:

    What with the superfluous parentheses with quote ?

    Why
    (quote (a b c ))

    in stead of

    (quote a b c ) ?

    After all quote is a special function, it decides for itself
    whether the arguments are evaluated.

    Groetjes Albert

    The special form quote takes one argument.

    CL-USER> (defmacro maybe-quote (itm)
    (if (constantp itm) itm `',itm))
    MAYBE-QUOTE
    CL-USER> (maybe-quote 3)
    3
    CL-USER> (maybe-quote 4)
    4
    CL-USER> (maybe-quote this)
    THIS
    CL-USER> (maybe-quote this)
    THIS
    CL-USER>
    ; No value
    CL-USER> (maybe-quote 'that)
    THAT
    CL-USER>

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)