Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DrRacket and trs2-impl.scm #1

Open
elfi opened this issue Aug 14, 2019 · 2 comments
Open

DrRacket and trs2-impl.scm #1

elfi opened this issue Aug 14, 2019 · 2 comments

Comments

@elfi
Copy link

elfi commented Aug 14, 2019

Hi,

I'm starting to read the book and would like to play with examples along - using DrRacket.
However,

#lang Racket   (or R5RS)
(load "/tmp/CodeFromTheReasonedSchemer2ndEd/trs2-impl.scm")

leads to an error:

/tmp/CodeFromTheReasonedSchemer2ndEd/trs2-impl.scm:20:0: #%top-interaction: unbound identifier;
 also, no #%app syntax transformer is bound in: #%top-interaction

How can I use trs2-impl.scm implementation in DrRacket?

Thank you!

@hayesall
Copy link

Here is a fix:

Modify trs2-impl.scm to declare a language and provide functions/macros:

; file trs2-impl.rkt

#lang racket

(provide run
	 run*
	 var?
         ==
         conj
         disj
         succeed
         fail
         fresh
         conde
         conda
         condu
	 )

In DrRacket, use require:

#lang racket

; This assumes `trs2-impl.scm` is in your home directory, modify as needed.
(require "trs2-impl.scm")

(run* q
      (disj
       (== q 5)
       (== q 6)))

@elfi
Copy link
Author

elfi commented Oct 22, 2020

Yes, this solves the problem. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants