morte has quit [Remote host closed the connection]
notzmv has joined #racket
ec has quit [Ping timeout: 240 seconds]
ec has joined #racket
dhil has joined #racket
thegeekinside has quit [Remote host closed the connection]
thegeekinside has joined #racket
thegeekinside has quit [Remote host closed the connection]
<Putonlalla>
My procedure or macro is given an association list as an argument. How can I pass it into `parameterize` to serve as bindings? I can't find any way to control evaluation or macro expansion order to do this in R5RS.
<Putonlalla>
If I allow myself to `(#%require (prefix base: racket/base))`, then I can do ``(base:define-namespace-anchor anchor) (define (with-instance-thunk inst thunk) (eval `(parameterize ,inst (,thunk)) (base:namespace-anchor->namespace anchor)))``.
<Putonlalla>
Your suggestion fails with `extend-parameterization: contract violation`.
<samth>
Putonlalla: what's the rest of that error message?
<samth>
doing `eval` is almost certainly a terrible idea
<Putonlalla>
The rest says `expected: parameter?` but `given: fmap-method`. I have previously run `(define fmap-method (make-parameter 'unimplemented-method))`.
<Putonlalla>
I'm exploring an alternative way to express type classes; one, that also supports constraints/dependent types.
<Putonlalla>
It "works", but relies on Racket's `eval`, as you can see.
<samth>
Putonlalla: are you passing in the symbol `'fmap-method` rather than the value `fmap-method`?