Maybe macros
John Cowan
(26 Jun 2020 17:16 UTC)
|
Re: Maybe macros
Marc Nieper-Wißkirchen
(26 Jun 2020 17:43 UTC)
|
Re: Maybe macros
John Cowan
(26 Jun 2020 18:48 UTC)
|
Re: Maybe macros
Marc Nieper-Wißkirchen
(26 Jun 2020 18:57 UTC)
|
Re: Maybe macros
John Cowan
(27 Jun 2020 04:29 UTC)
|
Re: Maybe macros
Arthur A. Gleckler
(26 Jun 2020 19:50 UTC)
|
Re: Maybe macros
John Cowan
(26 Jun 2020 19:52 UTC)
|
Re: Maybe macros
Wolfgang Corcoran-Mathe
(27 Jun 2020 03:44 UTC)
|
Re: Maybe macros
Arthur A. Gleckler
(27 Jun 2020 03:59 UTC)
|
Re: Maybe macros
Wolfgang Corcoran-Mathe
(27 Jun 2020 04:15 UTC)
|
Re: Maybe macros
Arthur A. Gleckler
(27 Jun 2020 04:29 UTC)
|
Re: Maybe macros
Wolfgang Corcoran-Mathe
(27 Jun 2020 14:09 UTC)
|
Re: Maybe macros
John Cowan
(27 Jun 2020 18:55 UTC)
|
Re: Maybe macros Marc Nieper-Wißkirchen (27 Jun 2020 20:46 UTC)
|
Re: Maybe macros
John Cowan
(27 Jun 2020 21:34 UTC)
|
Re: Maybe macros
Wolfgang Corcoran-Mathe
(28 Jun 2020 17:26 UTC)
|
Re: Maybe macros
Marc Nieper-Wißkirchen
(28 Jun 2020 17:43 UTC)
|
Re: Maybe macros
Wolfgang Corcoran-Mathe
(28 Jun 2020 18:52 UTC)
|
Re: Maybe macros
Marc Nieper-Wißkirchen
(28 Jun 2020 20:24 UTC)
|
Re: Maybe macros
John Cowan
(28 Jun 2020 18:54 UTC)
|
Re: Maybe macros
Marc Nieper-Wißkirchen
(28 Jun 2020 20:21 UTC)
|
Re: Maybe macros
Alex Shinn
(29 Jun 2020 00:02 UTC)
|
Re: Maybe macros
Marc Nieper-Wißkirchen
(29 Jun 2020 06:23 UTC)
|
Re: Maybe macros
Wolfgang Corcoran-Mathe
(28 Jun 2020 16:54 UTC)
|
Am Sa., 27. Juni 2020 um 20:55 Uhr schrieb John Cowan <xxxxxx@ccil.org>: > > Sounds good to me. So the list of new macros is maybe-and, maybe-or, maybe-and-let* (more verbose but clearer), and their either-* analogues. I'll add these to SRFI 189 when I have a chance. > > I don't think we need -each-in-list if we define -and to work that way: it returns the first Nothing/Left if there is one, or the last Just/Right if there isn't. This is exactly how standard Scheme `and` works. If there are no arguments, you get a wrapped #t. There's a difference to the standard `and' because `each-in-list' is not a special form and all arguments will be evaluated. > Of course -or is the dual: it returns the first Just/Right if there is one, and the last Nothing/Left if there isn't. (There is no need to say "last" in R7RS-small, because there is only one #f). If there are no arguments, you get Nothing or (I suppose) Left #f. I have to think of how much `-and' and `-or' without any argument make sense logically. In any case, the payload of the Just/Right or the Left would have nothing to do with truth or the falsehood of the `-and' or `-or' form. So wrapping `#t' or `#f' is definitely not "the right thing". Zero values may make sense, so that, say, `(either-or ...)' becomes equivalent to `(either-or (left) ...)' and `(either-and ...)' becomes equivalent to `(either-and (right) ...)'. Marc