newLISP Fan Club

Forum => newLISP newS => Topic started by: Tim Johnson on May 11, 2008, 10:23:13 AM

Title: Newlisp - Reasoned Schemer - kanren-book
Post by: Tim Johnson on May 11, 2008, 10:23:13 AM
I just got the "Reasoned Schemer".



The code that supports the lessons in the book are at:

http://sourceforge.net/project/showfiles.php?group_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
Title:
Post by: cormullion on May 11, 2008, 11:14:34 AM
I suspect that it wouldn't be too hard, if you understood Scheme. I can guess  at one:


(define nl (string #newline))

could be


(define (nl) (string "n"))

Luckily there are some schemers on this forum.
Title:
Post by: Tim Johnson on May 11, 2008, 12:22:38 PM
Sounds promising. I've barely fooled around with scheme, but

I do have a couple of books here on the language specs.

thnx

tim
Title:
Post by: Lutz on May 11, 2008, 01:08:17 PM
The newLISP equivalent would be:


(define nl "n")

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.