Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

Machines take me by surprise with great frequency. -- Alan Turing


devel / comp.lang.scheme / Re: nice way to write (define) Slices in R7RS ?

SubjectAuthor
* nice way to write (define) Slices in R7RS ?Hen Hanna
+- Re: nice way to write (define) Slices in R7RS ?Paul Rubin
`- Re: nice way to write (define) Slices in R7RS ?Hen Hanna

1
nice way to write (define) Slices in R7RS ?

<0ba2b865-72b1-475d-8c7d-23c1d18433bbn@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.scheme
X-Received: by 2002:a5d:65c1:0:b0:210:33b7:4525 with SMTP id e1-20020a5d65c1000000b0021033b74525mr16042393wrw.494.1655602650048;
Sat, 18 Jun 2022 18:37:30 -0700 (PDT)
X-Received: by 2002:a81:d05:0:b0:317:76a1:9507 with SMTP id
5-20020a810d05000000b0031776a19507mr16776257ywn.151.1655602649589; Sat, 18
Jun 2022 18:37:29 -0700 (PDT)
Path: i2pn2.org!i2pn.org!aioe.org!news.mixmin.net!proxad.net!feeder1-2.proxad.net!209.85.128.87.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.scheme
Date: Sat, 18 Jun 2022 18:37:29 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=2601:648:8600:d320:0:0:0:4941;
posting-account=YjTkGAoAAAA4_fbAISfvtIqrYbghMeBx
NNTP-Posting-Host: 2601:648:8600:d320:0:0:0:4941
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <0ba2b865-72b1-475d-8c7d-23c1d18433bbn@googlegroups.com>
Subject: nice way to write (define) Slices in R7RS ?
From: henhanna@gmail.com (Hen Hanna)
Injection-Date: Sun, 19 Jun 2022 01:37:30 +0000
Content-Type: text/plain; charset="UTF-8"
 by: Hen Hanna - Sun, 19 Jun 2022 01:37 UTC

this is Slices in Gauche... what 's a nice way to write (define) it ?

(define a '(a b c d e f g h i j k l m n o p q r s t u v w x y z))

(slices a 2) --> ((a b) (c d) (e f) (g h) (i j) (k l) (m n) (o p) (q r) (s t) (u v) (w x) (y z))

(slices a 3) --> ((a b c) (d e f) (g h i) (j k l) (m n o) (p q r) (s t u) (v w x) (y z))

(slices a 4) --> ((a b c d) (e f g h) (i j k l) (m n o p) (q r s t) (u v w x) (y z))

(slices a 5) --> ((a b c d e) (f g h i j) (k l m n o) (p q r s t) (u v w x y) (z))

Re: nice way to write (define) Slices in R7RS ?

<877d5do0o7.fsf@nightsong.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.scheme
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: no.email@nospam.invalid (Paul Rubin)
Newsgroups: comp.lang.scheme
Subject: Re: nice way to write (define) Slices in R7RS ?
Date: Sat, 18 Jun 2022 19:19:04 -0700
Organization: A noiseless patient Spider
Lines: 4
Message-ID: <877d5do0o7.fsf@nightsong.com>
References: <0ba2b865-72b1-475d-8c7d-23c1d18433bbn@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: reader02.eternal-september.org; posting-host="c3bc43b87f7e12045c10ff09e459e8ad";
logging-data="4975"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19/TF9XBTnWj+dgzhRmhrHP"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
Cancel-Lock: sha1:fDw1MnW19nDCWMm+NIV/ecIp0oE=
sha1:SXeSNbbeFnnIBGmL0kR6Y1mPPDA=
 by: Paul Rubin - Sun, 19 Jun 2022 02:19 UTC

Hen Hanna <henhanna@gmail.com> writes:
> this is Slices in Gauche... what 's a nice way to write (define) it ?

These start to sound like homework problems? What have you tried?

Re: nice way to write (define) Slices in R7RS ?

<a461d8bb-48f2-487c-9247-220405dfb518n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.scheme
X-Received: by 2002:adf:e189:0:b0:218:45f0:5c0a with SMTP id az9-20020adfe189000000b0021845f05c0amr16349919wrb.683.1655615021744;
Sat, 18 Jun 2022 22:03:41 -0700 (PDT)
X-Received: by 2002:a25:e089:0:b0:668:91ce:17ac with SMTP id
x131-20020a25e089000000b0066891ce17acmr16787865ybg.642.1655615021275; Sat, 18
Jun 2022 22:03:41 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.128.87.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.scheme
Date: Sat, 18 Jun 2022 22:03:41 -0700 (PDT)
In-Reply-To: <0ba2b865-72b1-475d-8c7d-23c1d18433bbn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2601:648:8600:d320:0:0:0:4941;
posting-account=YjTkGAoAAAA4_fbAISfvtIqrYbghMeBx
NNTP-Posting-Host: 2601:648:8600:d320:0:0:0:4941
References: <0ba2b865-72b1-475d-8c7d-23c1d18433bbn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <a461d8bb-48f2-487c-9247-220405dfb518n@googlegroups.com>
Subject: Re: nice way to write (define) Slices in R7RS ?
From: henhanna@gmail.com (Hen Hanna)
Injection-Date: Sun, 19 Jun 2022 05:03:41 +0000
Content-Type: text/plain; charset="UTF-8"
 by: Hen Hanna - Sun, 19 Jun 2022 05:03 UTC

On Saturday, June 18, 2022 at 6:37:32 PM UTC-7, Hen Hanna wrote:
> this is Slices in Gauche... what 's a nice way to write (define) it ?
>
>
> (define a '(a b c d e f g h i j k l m n o p q r s t u v w x y z))
>
> (slices a 2) --> ((a b) (c d) (e f) (g h) (i j) (k l) (m n) (o p) (q r) (s t) (u v) (w x) (y z))
>
> (slices a 3) --> ((a b c) (d e f) (g h i) (j k l) (m n o) (p q r) (s t u) (v w x) (y z))
>
> (slices a 4) --> ((a b c d) (e f g h) (i j k l) (m n o p) (q r s t) (u v w x) (y z))
>
> (slices a 5) --> ((a b c d e) (f g h i j) (k l m n o) (p q r s t) (u v w x y) (z))

(not homework)

what i'd do... use DO and var RES,
get a slice with Take and push it onto RES
recurse down using Drop

at the end , return (reverse! res)

------------ if there's another way taht's clever, interesting, .... pls let me know !!!

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor