Linked-List Problem

From: Leo Wong and Mary Murphy <hello_at_albany.net>
Date: Sun, 06 May 2001 08:09:45 -0400

I can do this in v.1.50.4 and get the expected result:

: list ( -- ) CREATE HERE 0 , , ;
: attach ( list -- ) CELL+ ALIGN HERE SWAP 2DUP @ ! ! ;
: add-link ( list -- ) attach 0 , ;

list Alist

: last? ( list -- ) BEGIN DUP @ DUP WHILE NIP REPEAT DROP CELL+ ? ;
: adds ( -- ) 100000 0 DO Alist add-link I , LOOP ;

adds Alist last?

With SF v2.2.2.5 (Trial Version), I get:

Access_violation

and when I do EMPTY, I get:

Call chain error

Leo Wong

--
hello_at_albany.net
http://www.albany.net/~hello/
----------------------------------------------------------------------
sftalk_at_forth.com      The SwiftForth programming discussion email list
To unsubscribe,  send subject "unsubscribe sftalk" to listar_at_forth.com
For help with listar commands, send subject "help" to listar_at_forth.com
Archives are located at http://www.forth.com/sftalk -- check them out!
Received on Sun May 06 2001 - 05:04:42 PDT

Subscribe to our e-mail list service. It's free for all SwiftForth and SwiftX users!

This archive was generated 06-Feb-2012. Archive updated nightly.