tonyg changed the topic of #racket to: The Racket Programming Language -- https://racket-lang.org/ -- https://gather.town/app/wH1EDG3McffLjrs0/racket-users -- http://pasterack.org -- logged at https://libera.irclog.whitequark.org/racket/ -- This is the right place to ask for help with (Dr)Racket. Remember to wait around for an answer!
lucasta has joined #racket
morte_ has joined #racket
lucasta has quit [Remote host closed the connection]
lucasta has joined #racket
Origin has quit [Ping timeout: 240 seconds]
lucasta has quit [Quit: Leaving]
thegeekinside has quit [Ping timeout: 265 seconds]
thegeekinside has joined #racket
thegeekinside has quit [Ping timeout: 240 seconds]
thegeekinside has joined #racket
thegeekinside has quit [Ping timeout: 240 seconds]
thegeekinside has joined #racket
thegeekinside has quit [Remote host closed the connection]
thegeekinside has joined #racket
thegeekinside has quit [Ping timeout: 248 seconds]
thegeekinside has joined #racket
terrorjack has quit [Quit: The Lounge - https://thelounge.chat]
terrorjack has joined #racket
morte has joined #racket
morte_ has quit [Ping timeout: 250 seconds]
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.
mwnaylor has quit [Ping timeout: 248 seconds]
<Putonlalla> The obvious ``(define (with-instance inst proc) (eval `(parameterize ,inst (proc))))`` doesn't work.
morte_ has joined #racket
dhil has quit [Ping timeout: 246 seconds]
szkl has joined #racket
<samth> Putonlalla: write a recursive function
<samth> Putonlalla: `(define (with-instance l p) (if (null? l) (p) (parameterize ([(caar l) (cdar l)]) (with-instance (cdr l) p))))`
<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`?
<Putonlalla> This is what I have. https://pastebin.com/bzNXYhT4
<Putonlalla> That's the minimized version, anyway.
<samth> Putonlalla: you need an unquote before `fmap-method` in `list-functor`
<Putonlalla> Now it throws some other error. I'll have to investigate later.
<samth> Putonlalla: your alist has an extra cons, so you can either change `cdar` to `cadar` or add a ` . ` in the quoted alist
<Putonlalla> Thanks, I'll have to look into it.
<samth> as an example of what doesn't work with `eval`, try putting a `(let () ...)` around the definition and use of `list-functor`
szkl has quit [Quit: Connection closed for inactivity]
morte_ has quit [Ping timeout: 248 seconds]
Tuplanolla has joined #racket
dhil has joined #racket
skapata has quit [Read error: Connection reset by peer]
simendsjo has joined #racket
notzmv has quit [Ping timeout: 265 seconds]
morte_ has joined #racket
morte_ is now known as morte
mwnaylor has joined #racket
dhil has quit [Ping timeout: 240 seconds]
Putonlalla has quit [*.net *.split]
Putonlalla has joined #racket
morte has quit [Remote host closed the connection]
Tuplanolla has quit [Ping timeout: 265 seconds]
Tuplanolla has joined #racket
mange has joined #racket
morte has joined #racket
Origin has joined #racket
Tuplanolla has quit [Quit: Leaving.]