all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Re: [Emacs-diffs] master 4612b2a 1/2: Implement and-let*
       [not found] ` <20170912171815.13B9520DE6@vcs0.savannah.gnu.org>
@ 2017-09-12 17:21   ` Stefan Monnier
  2017-09-12 17:29     ` Mark Oteiza
  2017-09-13 16:39     ` Richard Stallman
  0 siblings, 2 replies; 4+ messages in thread
From: Stefan Monnier @ 2017-09-12 17:21 UTC (permalink / raw)
  To: emacs-devel; +Cc: Mark Oteiza

>     (internal--build-binding-value-form): Extend to account for
>     solitary symbols and (EXPR) items in binding varlist.

We're forced to accept those forms in `let` and `let*` for historical
reasons, but why do we want to also accept them in newer constructs?


        Stefan



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Emacs-diffs] master 4612b2a 1/2: Implement and-let*
  2017-09-12 17:21   ` [Emacs-diffs] master 4612b2a 1/2: Implement and-let* Stefan Monnier
@ 2017-09-12 17:29     ` Mark Oteiza
  2017-09-13 16:39     ` Richard Stallman
  1 sibling, 0 replies; 4+ messages in thread
From: Mark Oteiza @ 2017-09-12 17:29 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

On 12/09/17 at 01:21pm, Stefan Monnier wrote:
> >     (internal--build-binding-value-form): Extend to account for
> >     solitary symbols and (EXPR) items in binding varlist.
> 
> We're forced to accept those forms in `let` and `let*` for historical
> reasons, but why do we want to also accept them in newer constructs?

Solitary symbols are expanded as x -> (x (and PREV x)), so it's not the
historical behavior.  (EXPR) means EXPR is an s-expression, which
doesn't make sense in let or let*, e.g.:

   (let (x)
     (and-let* (((null x))) "it's null"))



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Emacs-diffs] master 4612b2a 1/2: Implement and-let*
  2017-09-12 17:21   ` [Emacs-diffs] master 4612b2a 1/2: Implement and-let* Stefan Monnier
  2017-09-12 17:29     ` Mark Oteiza
@ 2017-09-13 16:39     ` Richard Stallman
  2017-09-14 15:46       ` Michael Heerdegen
  1 sibling, 1 reply; 4+ messages in thread
From: Richard Stallman @ 2017-09-13 16:39 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: mvoteiza, emacs-devel

[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

  > >     (internal--build-binding-value-form): Extend to account for
  > >     solitary symbols and (EXPR) items in binding varlist.

  > We're forced to accept those forms in `let` and `let*` for historical
  > reasons,

It is not just a matter of history.
Those are very convenient in 'let'.
It would be a bad idea not to have them.

Whether they are useful in other new constructs, I don't know.
What do these new constructs look like?

-- 
Dr Richard Stallman
President, Free Software Foundation (gnu.org, fsf.org)
Internet Hall-of-Famer (internethalloffame.org)
Skype: No way! See stallman.org/skype.html.




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Emacs-diffs] master 4612b2a 1/2: Implement and-let*
  2017-09-13 16:39     ` Richard Stallman
@ 2017-09-14 15:46       ` Michael Heerdegen
  0 siblings, 0 replies; 4+ messages in thread
From: Michael Heerdegen @ 2017-09-14 15:46 UTC (permalink / raw)
  To: Richard Stallman; +Cc: mvoteiza, Stefan Monnier, emacs-devel

Richard Stallman <rms@gnu.org> writes:

>   > >     (internal--build-binding-value-form): Extend to account for
>   > >     solitary symbols and (EXPR) items in binding varlist.
>
>   > We're forced to accept those forms in `let` and `let*` for historical
>   > reasons,
>
> It is not just a matter of history.
> Those are very convenient in 'let'.
> It would be a bad idea not to have them.

> Whether they are useful in other new constructs, I don't know.
> What do these new constructs look like?

Just search for SRFI 2, e.g.

  https://www.gnu.org/software/guile/manual/html_node/SRFI_002d2.html

`if-let*' and `when-let*' in Emacs are analogue.

I don't know much about Lisp's history, but I think there was a
misunderstanding about what these special binding forms mean.  For
example, making a binding form consisting of a single symbol mean "bind
the symbol to nil" would not make sense in these new constructs -
instead, we test the symbol's value for nilness.


Michael.



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-09-14 15:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20170912171813.26498.77867@vcs0.savannah.gnu.org>
     [not found] ` <20170912171815.13B9520DE6@vcs0.savannah.gnu.org>
2017-09-12 17:21   ` [Emacs-diffs] master 4612b2a 1/2: Implement and-let* Stefan Monnier
2017-09-12 17:29     ` Mark Oteiza
2017-09-13 16:39     ` Richard Stallman
2017-09-14 15:46       ` Michael Heerdegen

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.