Re: The Little Prover and Scheme 48
Heath Putnam <[email protected]> Wed, 5 Aug 2015 21:32:10 -0700
| Newsgroups | gmane.lisp.scheme.scheme48 |
|---|---|
| Message-ID | <CAJBZ0giF4-8kt5bHNou9UP+nzcop8tKzOxpG0gEvcD-_OwZkWQ@mail.gmail.com> |
Watson,
I took a look at it.
The source file uses "if". It also redefines it on line 20. Looking at
it, it seems the intent is that before line 20 "if" should mean the
normal if, while any definitions coming after should use the new
definition.
I don't think scheme48's package system does things that way. I seem
to remember it identifies macros and uses them when loading the
package.
This may not be the most elegant way to do it, but it should allow you
to progress:
1) make a package that loads the normal "if" as "s.if"
2) Change j-bob-lang.scm so that the uses of if before line 20 to use
"s.if" instead of if.
The transcript below shows how to make a special package where the
normal "if" is called "s.if" and how you could change the code in
j-bob-lang.scm to use s.if instead of if.
If for some reason this doesn't make sense, please let me know and
I'll try to help.
Good luck.
Heath
,config (define-structure j-bob (export) (open (modify scheme (rename
(if s.if)))))
; no values returned
> ,in j-bob
j-bob> (define (if/nil Q A E) ;; do the same for ATOM, CAR, etc
(s.if (equal? Q 'nil) (E) (A)))
; no values returned
j-bob> (define (atom x) (s.if (pair? x) 'nil 't))
; no values returned
j-bob> (atom '(ham eggs))
nil
j-bob>
On Wed, Aug 5, 2015 at 8:18 PM, Watson Ladd <[email protected]> wrote:
> Hello,
>
> I tried using J-Bob in my favorite scheme implementation and
> immediately ran into problems. Evaluating (atom '(ham eggs)) lead to a
> Scheme48 heap overflow. When I typed in what I thought was the
> troublesome definition myself nothing was wrong.
>
> The relevant file is at
> https://github.com/the-little-prover/j-bob/blob/master/scheme/j-bob-lang.scm.
> I gave it a look, but didn't find anything that explained why Scheme48
> behaved the way it did.
>
> Sincerely,
> Watson
>