Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

<wiggy> in a stunning new move I actually tested this upload


devel / comp.lang.forth / Re: .Re: Confused about Scheme...???

SubjectAuthor
* .Re: Confused about Scheme...???Robert L.
+* Re: .Re: Confused about Scheme...???Ron AARON
|`* Re: .Re: Confused about Scheme...???Hans Bezemer
| `- Re: .Re: Confused about Scheme...???Paul Rubin
`* Re: .Re: Confused about Scheme...???S Jack
 +* Re: .Re: Confused about Scheme...???Marcel Hendrix
 |`* Re: .Re: Confused about Scheme...???Marcel Hendrix
 | `- Re: .Re: Confused about Scheme...???dxforth
 `- Re: .Re: Confused about Scheme...???dxforth

1
.Re: Confused about Scheme...???

<t1pfvb$b2d$1@gioia.aioe.org>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=17398&group=comp.lang.forth#17398

 copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!aioe.org!+Jn9Lcdk4P01xEyP4J6GcA.user.46.165.242.75.POSTED!not-for-mail
From: No_spamm...@noWhere_7073.org (Robert L.)
Newsgroups: comp.lang.forth
Subject: .Re: Confused about Scheme...???
Date: Sun, 27 Mar 2022 10:57:49 -0000 (UTC)
Organization: Aioe.org NNTP Server
Message-ID: <t1pfvb$b2d$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Injection-Info: gioia.aioe.org; logging-data="11341"; posting-host="+Jn9Lcdk4P01xEyP4J6GcA.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: XanaNews/1.18.1.6
X-Notice: Filtered by postfilter v. 0.9.2
 by: Robert L. - Sun, 27 Mar 2022 10:57 UTC

> In short, 'reduce-list', is take a list of variable length, 'b',
> below and reduce it if the (caar ls) and (caadr ls) are equal...this
> is the first atom within the pair of consecutive sublists and if this
> is true contruct a list, (list (caar ls) (+ (cadar ls) (cadadr ls)))
> , and add second atom of the consective pairs. For example,
> (reduce-list b) ==> ((4 3) (3 7) (2 1) (1 2) (0 1)). I can get it to
> work for the first two terms without using recursion, produces (4 3),
> but when I implement recursion it barfs. Could some one tell me what
> I'm doing wrong because I know that I'm trying to do to much at once?
>
>
> -Conrad
>
>
> (define (reduce-list ls)
> (cond ((null? ls) ls)
> (else
> (cond ((null? (cadr ls)) ls)
> (else
> (cond ((eq? (caar ls) (caadr ls))
> (list (caar ls) (+ (cadar ls) (cadadr ls)))
> (reduce-list (cdr ls)))
> (else (list (car ls) (reduce-list (cdr ls)))))))))))
>
>
> (define b '((4 1) (4 2) (3 3) (3 4) (2 1) (1 2) (0 1)))
>
> (reduce-list b)

Gauche Scheme or Racket:

(use srfi-1) ;; span for Gauche
or
(require srfi/1) ;; span for Racket
(require srfi/8) ;; receive for Racket

(define b '((4 1) (4 2) (4 80) (3 3) (3 4) (2 1) (1 2) (0 1)))

(define (reduce-list xs)
(if (null? xs)
'()
(let ((k (caar xs)))
(receive (these those)
(span (lambda (ys) (equal? (car ys) k)) xs)
(cons (list k (apply + (map cadr these)))
(reduce-list those))))))

(reduce-list b)
===>
((4 83) (3 7) (2 1) (1 2) (0 1))

In Forth?

Re: .Re: Confused about Scheme...???

<t1pgv5$3of$1@dont-email.me>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=17399&group=comp.lang.forth#17399

 copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: clf...@8th-dev.com (Ron AARON)
Newsgroups: comp.lang.forth
Subject: Re: .Re: Confused about Scheme...???
Date: Sun, 27 Mar 2022 14:14:45 +0300
Organization: A noiseless patient Spider
Lines: 59
Message-ID: <t1pgv5$3of$1@dont-email.me>
References: <t1pfvb$b2d$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 27 Mar 2022 11:14:45 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="d0e167b6eaea8699d7294cf951d4f769";
logging-data="3855"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/8A3TyMNMslq/ig/9fzXAb"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
Thunderbird/91.7.0
Cancel-Lock: sha1:lOoluKh/hRcEu9Y8hWqHVV6rGAE=
In-Reply-To: <t1pfvb$b2d$1@gioia.aioe.org>
Content-Language: en-US
 by: Ron AARON - Sun, 27 Mar 2022 11:14 UTC

On 27/03/2022 13:57, Robert L. wrote:
>>
>> (define (reduce-list ls)
>> (cond ((null? ls) ls)
>> (else
>> (cond ((null? (cadr ls)) ls)
>> (else
>> (cond ((eq? (caar ls) (caadr ls))
>> (list (caar ls) (+ (cadar ls) (cadadr ls)))
>> (reduce-list (cdr ls)))
>> (else (list (car ls) (reduce-list (cdr ls)))))))))))
>>
>>
>> (define b '((4 1) (4 2) (3 3) (3 4) (2 1) (1 2) (0 1)))
>>
>> (reduce-list b)
>
>
> Gauche Scheme or Racket:
>
> (use srfi-1) ;; span for Gauche
> or
> (require srfi/1) ;; span for Racket
> (require srfi/8) ;; receive for Racket
>
> (define b '((4 1) (4 2) (4 80) (3 3) (3 4) (2 1) (1 2) (0 1)))
>
> (define (reduce-list xs)
> (if (null? xs)
> '()
> (let ((k (caar xs)))
> (receive (these those)
> (span (lambda (ys) (equal? (car ys) k)) xs)
> (cons (list k (apply + (map cadr these)))
> (reduce-list those))))))
>
> (reduce-list b)
> ===>
> ((4 83) (3 7) (2 1) (1 2) (0 1))
>
> In Forth?

In 8th:

[] [[4,1],[4,2],[4,80],[3,3],[3,4],[2,1],[1,2],[0,1]]]
( 0 a:_@ ) a:group
( nip 0 >r
( swap a:open swap r! n:+ ) 0 a:reduce
r> swap 2 a:close a:push
) m:each drop . cr

Outputs: [ [0,1], [3,7], [4,83], [1,2], [2,1]]

Why don't you find a different hobby?

Re: .Re: Confused about Scheme...???

<00be7f05-61a3-41a2-9d0a-75904096b01bn@googlegroups.com>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=17400&group=comp.lang.forth#17400

 copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a37:a24a:0:b0:67b:4836:fe95 with SMTP id l71-20020a37a24a000000b0067b4836fe95mr12658169qke.109.1648383288902;
Sun, 27 Mar 2022 05:14:48 -0700 (PDT)
X-Received: by 2002:a05:620a:2481:b0:67b:39ef:b3eb with SMTP id
i1-20020a05620a248100b0067b39efb3ebmr12600286qkn.188.1648383288713; Sun, 27
Mar 2022 05:14:48 -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.forth
Date: Sun, 27 Mar 2022 05:14:48 -0700 (PDT)
In-Reply-To: <t1pgv5$3of$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=82.95.228.79; posting-account=Ebqe4AoAAABfjCRL4ZqOHWv4jv5ZU4Cs
NNTP-Posting-Host: 82.95.228.79
References: <t1pfvb$b2d$1@gioia.aioe.org> <t1pgv5$3of$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <00be7f05-61a3-41a2-9d0a-75904096b01bn@googlegroups.com>
Subject: Re: .Re: Confused about Scheme...???
From: the.beez...@gmail.com (Hans Bezemer)
Injection-Date: Sun, 27 Mar 2022 12:14:48 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 4
 by: Hans Bezemer - Sun, 27 Mar 2022 12:14 UTC

On Sunday, March 27, 2022 at 1:14:47 PM UTC+2, Ron AARON wrote:
> Why don't you find a different hobby?
Or move your @$$ to a more appropriate Usenet group, e.g. (just a suggestion) comp.lang.lisp?

Hans Bezemer

Re: .Re: Confused about Scheme...???

<46e672d1-99f5-4b50-9749-a3a190a4f9can@googlegroups.com>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=17401&group=comp.lang.forth#17401

 copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:ad4:5be3:0:b0:441:2af0:6ea2 with SMTP id k3-20020ad45be3000000b004412af06ea2mr17053529qvc.116.1648390760906;
Sun, 27 Mar 2022 07:19:20 -0700 (PDT)
X-Received: by 2002:a05:622a:1906:b0:2e0:77a7:16c4 with SMTP id
w6-20020a05622a190600b002e077a716c4mr17862701qtc.119.1648390760732; Sun, 27
Mar 2022 07:19:20 -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.forth
Date: Sun, 27 Mar 2022 07:19:20 -0700 (PDT)
In-Reply-To: <t1pfvb$b2d$1@gioia.aioe.org>
Injection-Info: google-groups.googlegroups.com; posting-host=2600:1700:3f7a:20d0:cc29:46ad:4068:37a0;
posting-account=V5nGoQoAAAC_P2U0qnxm2kC0s1jNJXJa
NNTP-Posting-Host: 2600:1700:3f7a:20d0:cc29:46ad:4068:37a0
References: <t1pfvb$b2d$1@gioia.aioe.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <46e672d1-99f5-4b50-9749-a3a190a4f9can@googlegroups.com>
Subject: Re: .Re: Confused about Scheme...???
From: sdwjac...@gmail.com (S Jack)
Injection-Date: Sun, 27 Mar 2022 14:19:20 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 25
 by: S Jack - Sun, 27 Mar 2022 14:19 UTC

On Sunday, March 27, 2022 at 5:57:51 AM UTC-5, Robert L. wrote:
>
> (reduce-list b)
> ===>
> ((4 83) (3 7) (2 1) (1 2) (0 1))
>
> In Forth?

In Frog:
:) frogd
ELF32X86_64 Frog Version 1.0d

"job" /go
4 1 4 2 4 80 3 3 3 4 2 1 1 2 0 1
{ pad c/l erase 0 >R
begin
depth while over pad []^ +! R> MAX >R repeat
R> 1+ 0 do i i pad []
asc ( emit over . space . asc ) emit
loop
} i. e ==> (0 1 )(1 2 )(2 1 )(3 7 )(4 83 )

-fin-
ok
--
me

Re: .Re: Confused about Scheme...???

<874k3jgr2p.fsf@nightsong.com>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=17402&group=comp.lang.forth#17402

 copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: no.em...@nospam.invalid (Paul Rubin)
Newsgroups: comp.lang.forth
Subject: Re: .Re: Confused about Scheme...???
Date: Sun, 27 Mar 2022 11:58:54 -0700
Organization: A noiseless patient Spider
Lines: 5
Message-ID: <874k3jgr2p.fsf@nightsong.com>
References: <t1pfvb$b2d$1@gioia.aioe.org> <t1pgv5$3of$1@dont-email.me>
<00be7f05-61a3-41a2-9d0a-75904096b01bn@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: reader02.eternal-september.org; posting-host="af815b6ca8841d186755977281b0ee47";
logging-data="337"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19YUYVMCg/ckXpLGCn1d/1c"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
Cancel-Lock: sha1:Pt5qlIGL2fcvxstaIXcdVavkRFw=
sha1:z1lCI9ybxhlzZBjyYpkKHpCZp5U=
 by: Paul Rubin - Sun, 27 Mar 2022 18:58 UTC

Hans Bezemer <the.beez.speaks@gmail.com> writes:
> Or move your @$$ to a more appropriate Usenet group, e.g. (just a
> suggestion) comp.lang.lisp?

He is there too, with the same types of posts.

Re: .Re: Confused about Scheme...???

<a00ac795-d981-45d1-ad0c-f58f3e86497cn@googlegroups.com>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=17403&group=comp.lang.forth#17403

 copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a0c:d692:0:b0:432:3605:6192 with SMTP id k18-20020a0cd692000000b0043236056192mr17794567qvi.90.1648421594703;
Sun, 27 Mar 2022 15:53:14 -0700 (PDT)
X-Received: by 2002:ad4:5ca3:0:b0:440:f131:a7a4 with SMTP id
q3-20020ad45ca3000000b00440f131a7a4mr18393057qvh.16.1648421594581; Sun, 27
Mar 2022 15:53:14 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!1.us.feeder.erje.net!feeder.erje.net!border1.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.forth
Date: Sun, 27 Mar 2022 15:53:14 -0700 (PDT)
In-Reply-To: <46e672d1-99f5-4b50-9749-a3a190a4f9can@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2001:1c05:2f14:600:c47b:f56f:c91c:798a;
posting-account=-JQ2RQoAAAB6B5tcBTSdvOqrD1HpT_Rk
NNTP-Posting-Host: 2001:1c05:2f14:600:c47b:f56f:c91c:798a
References: <t1pfvb$b2d$1@gioia.aioe.org> <46e672d1-99f5-4b50-9749-a3a190a4f9can@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <a00ac795-d981-45d1-ad0c-f58f3e86497cn@googlegroups.com>
Subject: Re: .Re: Confused about Scheme...???
From: mhx...@iae.nl (Marcel Hendrix)
Injection-Date: Sun, 27 Mar 2022 22:53:14 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 21
 by: Marcel Hendrix - Sun, 27 Mar 2022 22:53 UTC

On Sunday, March 27, 2022 at 4:19:21 PM UTC+2, S Jack wrote:
[..]
> In Frog:

CREATE b 4 , 1 , 4 , 2 , 4 , 80 , 3 , 3 , 3 , 4 , 2 , 1 , 1 , 2 , 0 , 1 , -1 ,

: .list ( addr -- ) CR BEGIN @+ DUP 0>= WHILE '(' EMIT . @+ 0 U.R ." ) " REPEAT 2DROP ;

: rl ( addr -- )
DUP LOCAL list
DUP @ LOCAL next
0 LOCAL sum
BEGIN next 0>=
WHILE CELL+ @+ +TO sum
DUP @ next <> IF next list !+ sum SWAP ! 2 CELLS +TO list
CLEAR sum DUP @ TO next
ENDIF
REPEAT DROP -1 list ! ;
FORTH> b rl b .list
(4 83) (3 7) (2 1) (1 2) (0 1) ok

-marcel

Re: .Re: Confused about Scheme...???

<t1r19n$4ao$1@gioia.aioe.org>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=17404&group=comp.lang.forth#17404

 copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!aioe.org!7AktqsUqy5CCvnKa3S0Dkw.user.46.165.242.75.POSTED!not-for-mail
From: dxfo...@gmail.com (dxforth)
Newsgroups: comp.lang.forth
Subject: Re: .Re: Confused about Scheme...???
Date: Mon, 28 Mar 2022 11:59:41 +1100
Organization: Aioe.org NNTP Server
Message-ID: <t1r19n$4ao$1@gioia.aioe.org>
References: <t1pfvb$b2d$1@gioia.aioe.org>
<46e672d1-99f5-4b50-9749-a3a190a4f9can@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="4440"; posting-host="7AktqsUqy5CCvnKa3S0Dkw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.7.0
Content-Language: en-GB
X-Notice: Filtered by postfilter v. 0.9.2
 by: dxforth - Mon, 28 Mar 2022 00:59 UTC

On 28/03/2022 01:19, S Jack wrote:
> On Sunday, March 27, 2022 at 5:57:51 AM UTC-5, Robert L. wrote:
>>
>> (reduce-list b)
>> ===>
>> ((4 83) (3 7) (2 1) (1 2) (0 1))
>>
>> In Forth?
>
> In Frog:
> :) frogd
> ELF32X86_64 Frog Version 1.0d
>
> "job" /go
> 4 1 4 2 4 80 3 3 3 4 2 1 1 2 0 1
> { pad c/l erase 0 >R
> begin
> depth while over pad []^ +! R> MAX >R repeat
> R> 1+ 0 do i i pad []
> asc ( emit over . space . asc ) emit
> loop
> } i. e ==> (0 1 )(1 2 )(2 1 )(3 7 )(4 83 )
>
> -fin-
> ok

At least now I understand what the fuss is about. The abstractions only
served to get in the way.

Re: .Re: Confused about Scheme...???

<9d050c1f-4258-4b5a-94cb-a68c5b289aabn@googlegroups.com>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=17405&group=comp.lang.forth#17405

 copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:6214:21ee:b0:441:4934:3c91 with SMTP id p14-20020a05621421ee00b0044149343c91mr19173363qvj.113.1648448291451;
Sun, 27 Mar 2022 23:18:11 -0700 (PDT)
X-Received: by 2002:a05:620a:1722:b0:67d:8efe:d4e8 with SMTP id
az34-20020a05620a172200b0067d8efed4e8mr14884546qkb.327.1648448291298; Sun, 27
Mar 2022 23:18:11 -0700 (PDT)
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.forth
Date: Sun, 27 Mar 2022 23:18:11 -0700 (PDT)
In-Reply-To: <a00ac795-d981-45d1-ad0c-f58f3e86497cn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2001:1c05:2f14:600:f43d:2497:b5f9:e944;
posting-account=-JQ2RQoAAAB6B5tcBTSdvOqrD1HpT_Rk
NNTP-Posting-Host: 2001:1c05:2f14:600:f43d:2497:b5f9:e944
References: <t1pfvb$b2d$1@gioia.aioe.org> <46e672d1-99f5-4b50-9749-a3a190a4f9can@googlegroups.com>
<a00ac795-d981-45d1-ad0c-f58f3e86497cn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <9d050c1f-4258-4b5a-94cb-a68c5b289aabn@googlegroups.com>
Subject: Re: .Re: Confused about Scheme...???
From: mhx...@iae.nl (Marcel Hendrix)
Injection-Date: Mon, 28 Mar 2022 06:18:11 +0000
Content-Type: text/plain; charset="UTF-8"
 by: Marcel Hendrix - Mon, 28 Mar 2022 06:18 UTC

On Monday, March 28, 2022 at 12:53:15 AM UTC+2, Marcel Hendrix wrote:
> On Sunday, March 27, 2022 at 4:19:21 PM UTC+2, S Jack wrote:
> [..]
> > In Frog:
>
> CREATE b 4 , 1 , 4 , 2 , 4 , 80 , 3 , 3 , 3 , 4 , 2 , 1 , 1 , 2 , 0 , 1 , -1 ,
>
> : .list ( addr -- ) CR BEGIN @+ DUP 0>= WHILE '(' EMIT . @+ 0 U.R ." ) " REPEAT 2DROP ;
>
> : rl ( addr -- )
> DUP LOCAL list
> DUP @ LOCAL next
> 0 LOCAL sum
> BEGIN next 0>=
> WHILE CELL+ @+ +TO sum
> DUP @ next <> IF next list !+ sum SWAP ! 2 CELLS +TO list
> CLEAR sum DUP @ TO next
> ENDIF
> REPEAT DROP -1 list ! ;
> FORTH> b rl b .list
> (4 83) (3 7) (2 1) (1 2) (0 1) ok
>
> -marcel

Or:

FORTH> see rl
Flags: ANSI
$0133E400 : rl
$0133E40A pop rbx
$0133E40B mov rcx, rbx
$0133E40E lea rsi, [rsi #-16 +] qword
$0133E412 mov [rsi] qword, rbx
$0133E415 mov rbx, rcx
$0133E418 push rbx
$0133E419 push [rbx] qword
$0133E41B pop rbx
$0133E41C lea rsi, [rsi #-16 +] qword
$0133E420 mov [rsi] qword, rbx
$0133E423 xor rbx, rbx
$0133E426 lea rsi, [rsi #-16 +] qword
$0133E42A mov [rsi] qword, rbx
$0133E42D pop rbx
$0133E42E nop
$0133E42F nop
$0133E430 cmp [rsi #16 +] qword, 0 b#
$0133E435 jl $0133E486 offset NEAR
$0133E43B mov rdi, [rbx 8 +] qword
$0133E43F add [rsi] qword, rdi
$0133E442 lea rdi, [rbx #16 +] qword
$0133E446 mov rcx, [rbx #16 +] qword
$0133E44A cmp rcx, [rsi #16 +] qword
$0133E44E mov rbx, rcx
$0133E451 mov rcx, rdi
$0133E454 mov rbx, rcx
$0133E457 je $0133E482 offset NEAR
$0133E45D mov rdi, [rsi #32 +] qword
$0133E461 mov rax, [rsi #16 +] qword
$0133E465 mov [rdi] qword, rax
$0133E468 mov rax, [rsi] qword
$0133E46B mov [rdi 8 +] qword, rax
$0133E46F add [rsi #32 +] qword, #16 b#
$0133E474 mov [rsi] qword, 0 d#
$0133E47B mov rdi, [rbx] qword
$0133E47E mov [rsi #16 +] qword, rdi
$0133E482 jmp $0133E430 offset SHORT
$0133E484 push rbx
$0133E485 pop rbx
$0133E486 mov rbx, [rsi #32 +] qword
$0133E48A mov [rbx] qword, -1 d#
$0133E491 add rsi, #48 b#
$0133E495 ;

In Scheme?

-marcel

Re: .Re: Confused about Scheme...???

<t1v4cv$9to$1@gioia.aioe.org>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=17408&group=comp.lang.forth#17408

 copy link   Newsgroups: comp.lang.forth
Path: i2pn2.org!i2pn.org!aioe.org!7AktqsUqy5CCvnKa3S0Dkw.user.46.165.242.75.POSTED!not-for-mail
From: dxfo...@gmail.com (dxforth)
Newsgroups: comp.lang.forth
Subject: Re: .Re: Confused about Scheme...???
Date: Wed, 30 Mar 2022 01:17:03 +1100
Organization: Aioe.org NNTP Server
Message-ID: <t1v4cv$9to$1@gioia.aioe.org>
References: <t1pfvb$b2d$1@gioia.aioe.org>
<46e672d1-99f5-4b50-9749-a3a190a4f9can@googlegroups.com>
<a00ac795-d981-45d1-ad0c-f58f3e86497cn@googlegroups.com>
<9d050c1f-4258-4b5a-94cb-a68c5b289aabn@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="10168"; posting-host="7AktqsUqy5CCvnKa3S0Dkw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.7.0
Content-Language: en-GB
X-Notice: Filtered by postfilter v. 0.9.2
 by: dxforth - Tue, 29 Mar 2022 14:17 UTC

On 28/03/2022 17:18, Marcel Hendrix wrote:
> On Monday, March 28, 2022 at 12:53:15 AM UTC+2, Marcel Hendrix wrote:
>> On Sunday, March 27, 2022 at 4:19:21 PM UTC+2, S Jack wrote:
>> [..]
>> > In Frog:
>>
>> CREATE b 4 , 1 , 4 , 2 , 4 , 80 , 3 , 3 , 3 , 4 , 2 , 1 , 1 , 2 , 0 , 1 , -1 ,
>>
>> : .list ( addr -- ) CR BEGIN @+ DUP 0>= WHILE '(' EMIT . @+ 0 U.R ." ) " REPEAT 2DROP ;
>>
>> : rl ( addr -- )
>> DUP LOCAL list
>> DUP @ LOCAL next
>> 0 LOCAL sum
>> BEGIN next 0>=
>> WHILE CELL+ @+ +TO sum
>> DUP @ next <> IF next list !+ sum SWAP ! 2 CELLS +TO list
>> CLEAR sum DUP @ TO next
>> ENDIF
>> REPEAT DROP -1 list ! ;
>> FORTH> b rl b .list
>> (4 83) (3 7) (2 1) (1 2) (0 1) ok
>>
>> -marcel
>
> Or:
>
> FORTH> see rl
> Flags: ANSI
> $0133E400 : rl
> $0133E40A pop rbx
> $0133E40B mov rcx, rbx
> $0133E40E lea rsi, [rsi #-16 +] qword
> $0133E412 mov [rsi] qword, rbx
> $0133E415 mov rbx, rcx
> $0133E418 push rbx
> $0133E419 push [rbx] qword
> $0133E41B pop rbx
> $0133E41C lea rsi, [rsi #-16 +] qword
> $0133E420 mov [rsi] qword, rbx
> $0133E423 xor rbx, rbx
> $0133E426 lea rsi, [rsi #-16 +] qword
> $0133E42A mov [rsi] qword, rbx
> $0133E42D pop rbx
> $0133E42E nop
> $0133E42F nop
> $0133E430 cmp [rsi #16 +] qword, 0 b#
> $0133E435 jl $0133E486 offset NEAR
> $0133E43B mov rdi, [rbx 8 +] qword
> $0133E43F add [rsi] qword, rdi
> $0133E442 lea rdi, [rbx #16 +] qword
> $0133E446 mov rcx, [rbx #16 +] qword
> $0133E44A cmp rcx, [rsi #16 +] qword
> $0133E44E mov rbx, rcx
> $0133E451 mov rcx, rdi
> $0133E454 mov rbx, rcx
> $0133E457 je $0133E482 offset NEAR
> $0133E45D mov rdi, [rsi #32 +] qword
> $0133E461 mov rax, [rsi #16 +] qword
> $0133E465 mov [rdi] qword, rax
> $0133E468 mov rax, [rsi] qword
> $0133E46B mov [rdi 8 +] qword, rax
> $0133E46F add [rsi #32 +] qword, #16 b#
> $0133E474 mov [rsi] qword, 0 d#
> $0133E47B mov rdi, [rbx] qword
> $0133E47E mov [rsi #16 +] qword, rdi
> $0133E482 jmp $0133E430 offset SHORT
> $0133E484 push rbx
> $0133E485 pop rbx
> $0133E486 mov rbx, [rsi #32 +] qword
> $0133E48A mov [rbx] qword, -1 d#
> $0133E491 add rsi, #48 b#
> $0133E495 ;
>
> In Scheme?

Without locals?

: rl ( addr -- )
DUP 0 2>R
DUP @ SWAP
BEGIN OVER 0>= WHILE
CELL+ @+ R> + >R
2DUP @ - IF
OVER R> SWAP R@ !+ !
R> 2 CELLS + >R 0 >R
NIP DUP @ SWAP
THEN
REPEAT 2DROP R> DROP -1 R> ! ;

b rl b .list
(4 83) (3 7) (2 1) (1 2) (0 1) ok

1
server_pubkey.txt

rocksolid light 0.9.7
clearnet tor