Subject: Re: Parsing/Lexing in Scheme
From: (Rob Warnock)
Date: 1998/02/11
Newsgroups: comp.lang.scheme
Message-ID: <6brhq5$>

Pierre Mai  <> wrote:
| Has someone built an implementation of Common Lisp read (i.e. with
| read-tables and things like read-delimited-list, etc.) in Scheme...

You might want to look at "SIOD" <URL:>
which says this in the man page:

     Files which are loaded by the interpreter  may  contain  the
     sequence  of  characters  parser:XXXXX  in  a comment in the
     first line[*] of the file.  This will result in  the  automatic
     loading  of  the  file parser_XXXXX.scm which must provide a
     procedure parser_XXXXX to return a  procedure  to  read  the
     forms  from  the  file  to be loaded. Useful values of XXXXX
     include read, pratt, and fasl.

[* actually, first few comment lines of a file], which allows things
like this:

	#!/usr/local/bin/siod -v01,-m2 

	main() := 
	{writes(nil,"Hello Scheme World.\n");
	 writes(nil,"fib(20) = ",fib(20),"\n");

	fib(x) := if x < 2 then x else fib(x-1) + fib(x-2)

Alternatively, MzScheme has "custom ports" and SCM has "soft ports",
which let you put Scheme procedures behind a port, so you could write
a wrapper around a plain file port.


Rob Warnock, 7L-551
Silicon Graphics, Inc.		Phone: 650-933-1673 [New area code!]
2011 N. Shoreline Blvd.		FAX: 650-933-4392
Mountain View, CA  94043	PP-ASEL-IA