Re: [racket-users] Embed Racket in C and call Racket procedure

2016-03-31 Thread Anthony Sterrett
On Wednesday, 30 March 2016 22:33:35 UTC-4, Matthew Flatt wrote: > You were close with > > ((dynamic-require 'hw 'hw)) > > but you're missing a quote: > > ((dynamic-require ''hw 'hw)) > > > When you make "base.c" as > > raco ctool --c-mods base.c hw.rkt > > then it's like > > (module

Re: [racket-users] Embed Racket in C and call Racket procedure

2016-03-30 Thread Matthew Flatt
You were close with ((dynamic-require 'hw 'hw)) but you're missing a quote: ((dynamic-require ''hw 'hw)) When you make "base.c" as raco ctool --c-mods base.c hw.rkt then it's like (module hw racket/base (provide hw) (define (hw) (displayln "Hello, world!"))) at a REPL, and

[racket-users] Embed Racket in C and call Racket procedure

2016-03-30 Thread Anthony Sterrett
I appear to be swimming upstream. There are all sorts of tutorials and references for *extending* Racket with C, but precious little about *embedding* it. Unfortunately, I require the latter. I have a file hw.rkt with the following contents: #lang racket/base (provide hw) (define (hw)