I have a Chez Scheme library "foo.ss":
(library (foo)
(export bar)
(import (rnrs))
(define (bar) "hello"))
>From Chez Scheme:
$ chezscheme
Chez Scheme Version 9.5.4
Copyright 1984-2020 Cisco Systems, Inc.
> (eval '((lambda () (import (foo)) (bar
"hello"
A Racket program "call.r
>
> 2. Just use the same namespace as eval-example.rkt
>
I had tried this, but it evals not just the example language but
Racket+example (i.e. Racket forms also eval, and the example language has
to be compatible with Racket).
1. Keep the new namespace, but use namespace-attach-module to att
I'd like to be able to eval a custom language from inside a module...
without instantiating modules multiple times.
With the help of Matthew Butterick, I've gotten this far:
; runtime.rkt
#lang racket
(printf "This is runtime.rkt~n")
; example.rkt
#lang racket
(require "runtime.rkt")
(pr
>
> (define-runtime-path example "example.rkt")
That works! Thanks!
--
You received this message because you are subscribed to the Google Groups
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to racket-users+unsubscr...@googlegroups.com
Suppose I've defined a simple language:
; example.rkt
#lang racket
(provide foo)
(define-syntax foo
(syntax-rules ()
((foo)
(printf "foo!~n"
Now I want to create an eval-example function which will evaluate forms in
my language:
> (eval-example '(foo))
foo!
If I'm working
The Racket documentation for equal? says
equality is recursively defined; if both v1 and v2 contain reference
> cycles, they are equal when the infinite unfoldings of the values would be
> equal.
I didn't quite believe my ears! :-) So I tried it with two pairs (a
b...) and four pairs (a b
In collects/racket/load.rkt, strip-context-and-eval installs a handler
for the default continuation prompt with
call-with-continuation-prompt... and then the handler simply calls
abort-current-continuation with the default continuation prompt again.
To my uneducated eye, this looks like a no-op: i
7 matches
Mail list logo