I just got the "Reasoned Schemer".
The code that supports the lessons in the book are at:
http://sourceforge.net/project/showfile ... p_id=99654
I'd welcome comments on how difficult it might be to port
the kanren code to newlisp.
On a scale of 1 to 10? :-)
thanks
Tim
Newlisp - Reasoned Schemer - kanren-book
-
- Posts: 253
- Joined: Thu Oct 07, 2004 7:21 pm
- Location: Palmer Alaska USA
-
- Posts: 2038
- Joined: Tue Nov 29, 2005 8:28 pm
- Location: latiitude 50N longitude 3W
- Contact:
I suspect that it wouldn't be too hard, if you understood Scheme. I can guess at one:
could be
Luckily there are some schemers on this forum.
Code: Select all
(define nl (string #\newline))
Code: Select all
(define (nl) (string "\n"))
-
- Posts: 253
- Joined: Thu Oct 07, 2004 7:21 pm
- Location: Palmer Alaska USA
The newLISP equivalent would be:
This is not defining a procedure but only a variable. Also newLISP does not have a character data type, but uses strings of length one for characters. Therefore we do not need to use 'string' to transform \#newline.
So in the end above statement is valid in newLISP and Scheme.
Code: Select all
(define nl "\n")
So in the end above statement is valid in newLISP and Scheme.