Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

What is research but a blind date with knowledge? -- Will Harvey


devel / comp.lang.scheme / Re: Othewise

SubjectAuthor
* OthewiseMaciek Godek
+- Re: OthewiseAmirouche Boubekki
`- Re: OthewiseGeorge Neuner

1
Othewise

<c270dca9-1de7-4257-a8c3-dd9ea5978b76n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=79&group=comp.lang.scheme#79

  copy link   Newsgroups: comp.lang.scheme
X-Received: by 2002:ac8:1e95:: with SMTP id c21mr13561248qtm.412.1633945099020;
Mon, 11 Oct 2021 02:38:19 -0700 (PDT)
X-Received: by 2002:a05:6830:310d:: with SMTP id b13mr20968363ots.120.1633945098767;
Mon, 11 Oct 2021 02:38:18 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.scheme
Date: Mon, 11 Oct 2021 02:38:18 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=213.192.68.153; posting-account=f7iIKQoAAAAkDKpUafc-4IXhmRAzdB5r
NNTP-Posting-Host: 213.192.68.153
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <c270dca9-1de7-4257-a8c3-dd9ea5978b76n@googlegroups.com>
Subject: Othewise
From: godek.maciek@gmail.com (Maciek Godek)
Injection-Date: Mon, 11 Oct 2021 09:38:19 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 29
 by: Maciek Godek - Mon, 11 Oct 2021 09:38 UTC

I sometimes find it convenient to be able to specify the "short-circuiting" of the "or" operator in the reverse order.

This happens in particular when I use the "and-let*" form, and I want to provide the default alternative:

Instead of

(or
(and-let* (...)
...)
default-value)

it might be preferable to write:

(otherwise default-value
(and-let* (...)
...))

where "otherwise" is defined trivially as

(define-syntax otherwise
(syntax-rules ()
((_) #false)
((_ expression) expression)
((_ expression . expressions)
(or (otherwise . expressions) expression))))

(so it effectively reverses the order of arguments to "or")

Do you think "otherwise" is a good name for this?
Or are there any alterantives that you'd recommend?

Re: Othewise

<e131af83-10de-40ac-8f19-77c185752770n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=89&group=comp.lang.scheme#89

  copy link   Newsgroups: comp.lang.scheme
X-Received: by 2002:a37:8ec6:: with SMTP id q189mr4805317qkd.145.1636453518656;
Tue, 09 Nov 2021 02:25:18 -0800 (PST)
X-Received: by 2002:a25:b213:: with SMTP id i19mr6872085ybj.393.1636453518411;
Tue, 09 Nov 2021 02:25:18 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.scheme
Date: Tue, 9 Nov 2021 02:25:18 -0800 (PST)
In-Reply-To: <c270dca9-1de7-4257-a8c3-dd9ea5978b76n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2a01:e0a:3f9:9f50:ad27:407c:7bf2:a025;
posting-account=g3jhewoAAAACSLBs7KSFY1eJIoX2ATKh
NNTP-Posting-Host: 2a01:e0a:3f9:9f50:ad27:407c:7bf2:a025
References: <c270dca9-1de7-4257-a8c3-dd9ea5978b76n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <e131af83-10de-40ac-8f19-77c185752770n@googlegroups.com>
Subject: Re: Othewise
From: amirouche.boubekki@gmail.com (Amirouche Boubekki)
Injection-Date: Tue, 09 Nov 2021 10:25:18 +0000
Content-Type: text/plain; charset="UTF-8"
 by: Amirouche Boubekki - Tue, 9 Nov 2021 10:25 UTC

On Monday, October 11, 2021 at 11:38:20 AM UTC+2, godek....@gmail.com wrote:
> I sometimes find it convenient to be able to specify the "short-circuiting" of the "or" operator in the reverse order.
>
> This happens in particular when I use the "and-let*" form, and I want to provide the default alternative:
>
> Instead of
>
> (or
> (and-let* (...)
> ...)
> default-value)
>
> it might be preferable to write:
>
> (otherwise default-value
> (and-let* (...)
> ...))
>
> where "otherwise" is defined trivially as
>
> (define-syntax otherwise
> (syntax-rules ()
> ((_) #false)
> ((_ expression) expression)
> ((_ expression . expressions)
> (or (otherwise . expressions) expression))))
>
> (so it effectively reverses the order of arguments to "or")
>
> Do you think "otherwise" is a good name for this?
> Or are there any alterantives that you'd recommend?

If the goal is to reverse `or`, why not write `(or c b a)` instead of `(or a b c)`?

Re: Othewise

<0sjuogpqmjjpb5gqss4gfvr2m44efoimk3@4ax.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=98&group=comp.lang.scheme#98

  copy link   Newsgroups: comp.lang.scheme
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: gneuner2@comcast.net (George Neuner)
Newsgroups: comp.lang.scheme
Subject: Re: Othewise
Date: Sat, 13 Nov 2021 00:42:03 -0500
Organization: A noiseless patient Spider
Lines: 40
Message-ID: <0sjuogpqmjjpb5gqss4gfvr2m44efoimk3@4ax.com>
References: <c270dca9-1de7-4257-a8c3-dd9ea5978b76n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Injection-Info: reader02.eternal-september.org; posting-host="b348dbd6a19a224f44084f879063d1bd";
logging-data="8124"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+FBQb4U28ZHao1s0x286GR9nfZEv1NLn0="
User-Agent: ForteAgent/8.00.32.1272
Cancel-Lock: sha1:6+oedXjiW1ESKvrZa47OKVpd8K0=
 by: George Neuner - Sat, 13 Nov 2021 05:42 UTC

On Mon, 11 Oct 2021 02:38:18 -0700 (PDT), Maciek Godek
<godek.maciek@gmail.com> wrote:

>I sometimes find it convenient to be able to specify the
>"short-circuiting" of the "or" operator in the reverse order.
>
>This happens in particular when I use the "and-let*" form, and I
>want to provide the default alternative:
>
>Instead of
>
>(or
> (and-let* (...)
> ...)
> default-value)
>
>it might be preferable to write:
>
>(otherwise default-value
> (and-let* (...)
> ...))
>
>where "otherwise" is defined trivially as
>
>(define-syntax otherwise
> (syntax-rules ()
> ((_) #false)
> ((_ expression) expression)
> ((_ expression . expressions)
> (or (otherwise . expressions) expression))))
>
>(so it effectively reverses the order of arguments to "or")
>
>Do you think "otherwise" is a good name for this?
>Or are there any alterantives that you'd recommend?

In keeping with other wrappers, perhaps "with-default"?

YMMV,
George

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor