[racket-users] Calling into a Chez Scheme library -- imported symbol rewritten in vm-eval?

2023-08-27 Thread Andrew Wilcox
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

[racket] what is the purpose of installing a handler for the default continuation prompt in racket/load?

2011-04-20 Thread Andrew Wilcox
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

[racket-users] What algorithm does Racket use to test cyclical data structures for equality?

2018-03-08 Thread Andrew Wilcox
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

[racket-users] How to eval a custom language from inside a module?

2018-11-12 Thread Andrew Wilcox
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

Re: [racket-users] How to eval a custom language from inside a module?

2018-11-13 Thread Andrew Wilcox
> > (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

[racket-users] Is there a way to eval a custom language from inside a module... without instantiating modules multiple times?

2018-11-16 Thread Andrew Wilcox
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

Re: [racket-users] Is there a way to eval a custom language from inside a module... without instantiating modules multiple times?

2018-11-16 Thread Andrew Wilcox
> > 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