mit-scheme-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

loading *parser in an R7RS-Small library


From: Arthur A. Gleckler
Subject: loading *parser in an R7RS-Small library
Date: Tue, 25 Jul 2023 20:09:23 -0700

I've run into a snag while converting all of my MIT Scheme code to use R7RS-Small define-library: I can't get *parser to load. Is there a way to do this?

Thanks.

Here are the source files and a transcript:

ei.scm

(load-option '*parser)

(define parse-non-negative-integer
  (*parser (match (+ (char-set char-set:numeric)))))

ei.sld

(define-library (ei)
  (export parse-non-negative-integer)
  (import (only (mit legacy runtime)
        *parser
        char-set
        char-set:numeric
        load-option)
      (scheme base))
  (include "/tmp/ei.scm"))

transcript

1 ]=> (load-option '*parser)

;Loading "load.scm"...
;  Loading "parser-unx.pkd"... done
;  Loading "shared.com"... done
;  Loading "matcher.com"... done
;  Loading "parser.com"... done
;... done
;Value: *parser

1 ]=> (find-scheme-libraries! "/tmp/ei.sld")

;Registering library (ei) from "ei.sld"... done
;Unspecified return value

1 ]=> (load "/tmp/ei.sld")

;Loading "/tmp/ei.sld"... done
;Unspecified return value

1 ]=> (ge '(ei))

;The object #[char-set 12], passed as an argument to +, is not a number.
;To continue, call RESTART with an option number:
; (RESTART 1) => Return to read-eval-print level 1.

2 error> (debug)

There are 18 subproblems on the stack.

Subproblem level: 0 (this is the lowest subproblem level)
Compiled code _expression_ (from stack):
    (begin <!> z)
 subproblem being executed (marked by <!>):
    (if (not (complex:complex? z))
        (error:wrong-type-argument z "number" '+))
Environment created by the procedure: UNARY-+

 applied to: (#[char-set 12])
The execution history for this subproblem contains 1 reduction.
You are now in the debugger.  Type q to quit, ? for commands.

3 debug> v*parser
v

Evaluate _expression_:  
;Ignoring error:
;Transformer may not be used as an _expression_: #[transformer-item 13]

3 debug>

reply via email to

[Prev in Thread] Current Thread [Next in Thread]