@lupino8211 has joined the channel
Hi all! I wanted to create small language that utilizes Racket’s FFI abilities with some leverage of defining stuff. https://github.com/readysloth/REPLify I added two macros — use
, which loads dynamic library and header
, which parses header files and defines functions to interface (from library defined with use) After all of definitions user should be able to use standard Racket’s syntax to call stuff, but that line produces unbound identifier
, which, as I believe, is because Racket demands function name to be bound already, at compile time, when expander just expanded use
and header
… I guess I should shift phases somehow, but everything I tried didn’t work…
#lang racket
(require (for-syntax racket/string))
(begin-for-syntax
(let ([current-handler (error-display-handler)])
(error-display-handler
(λ (s v)
(current-handler (string-replace s
"bad syntax"
"terrible syntax")
v)))))
(define-syntax (foo stx)
(syntax-case stx ()
[(_) #'1]))
foo
@sorawee Thanks, that’s perfect!