lupino8211
2020-12-6 09:55:40

@lupino8211 has joined the channel


lupino8211
2020-12-6 10:00:33

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…


sorawee
2020-12-6 12:09:21

#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


kellysmith12.21
2020-12-6 12:12:47

@sorawee Thanks, that’s perfect!