Re: Four problems with Scheme 48 1.8

Martin Ward <[email protected]>
Newsgroups gmane.lisp.scheme.scheme48
Message-ID <[email protected]>
Thanks for your message!


On Tuesday 14 Jul 2009 13:09, you wrote:

> > (2) I cannot figure out how to define a macro such as:
> >
> > (defmacro substr (str from . rest)
> >   (if (null? rest)
> >       ; two argument form of substr:
> >       `(let ((s ,str))
> >          (substring s ,from (string-length s)))
> >       ; three argument form of substr:
> >       `(substring ,str ,from (+ ,from ,@rest))))
>
> Scheme48 doesn't have `define-macro'-style macros (which are a bad idea
> anyway, as they are inherently unhygienic); you'd either have to use
> syntax-rules, or use explicit-renaming macros[0]. For the above example,
> I syntax-rules suffices:
>
> (define-syntax substr
>   (syntax-rules ()
>     ((substr str from)
>      (let ((s str))
>        (substring s from (string-length s))))
>     ((substr str from count)
>      (substring str from (+ from count)))))

I was hoping that there would be a simple way to define defmacro using
define-syntax and syntax-rules, but I can't find one.
(There is something which lookd promising in SLIB, but I couldn't
get it to work).

> > (3) scheme48 won't accept ++ as a symbol name for some reason:
>
> ++ is not a valid identifier according to R5RS (from the section
> "Lexical structure"):

OK, I have replaced ++ by concat, and also fixed the calls to "-"
which have more than two arguments (I know that (- z1 z2 ...)
is only "optional" in R5RS, but it can't be *that* hard to implement... :-))

> > ALL2.scm is 6.7MB of scheme source.
>
> I think your heap size is too small; try starting scheme48 with a larger
> heap size, e.g.:
>
> % scheme48 -h 30000000

I recompiled scheme48 with the BIBOP garbage collector, so that it will
grow the heap as needed, but it still chokes on my program:

% scheme48 -h 0
Welcome to Scheme 48 1.8 (made by martin on Tue Jul 14 23:24:14 BST 2009)
Copyright (c) 1993-2008 by Richard Kelsey and Jonathan Rees.
Please report bugs to [email protected].
Get more information at http://www.s48.org/.
Type ,? (comma question-mark) for help.
> (load "ALL.scm")
ALL.scm

Error: VM limit exceeded: segment too large
       309153
       (&error)
1> 

I get the same error with scheme48 -h 30000000,
or, for that matter, -h 300000000.



-- 
			Martin

[email protected] http://www.cse.dmu.ac.uk/~mward/ Erdos number: 4
G.K.Chesterton web site: http://www.cse.dmu.ac.uk/~mward/gkc/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.