lexi-lambda changed the topic of #racket to: Racket v7.2 has been released: https://blog.racket-lang.org/2019/01/racket-v7-2.html -- Racket -- https://racket-lang.org -- https://pkgs.racket-lang.org -- Paste at http://pasterack.org
Sgeo_ has joined #racket
Sgeo__ has quit [Ping timeout: 245 seconds]
keep_learning_M has joined #racket
<jcowan> In MFTL all functions are keyword functions unless they have exactly one or two arguments (in which case they are operators) or zero arguments.
vraid has quit [Ping timeout: 252 seconds]
iclon__ has joined #racket
iclon_ has quit [Ping timeout: 246 seconds]
orivej has quit [Ping timeout: 255 seconds]
caltelt has quit [Remote host closed the connection]
dbmikus_ has quit [Ping timeout: 246 seconds]
pera has quit [Ping timeout: 255 seconds]
ubLIX has quit [Quit: ubLIX]
iyzsong has joined #racket
iyzsong has quit [Quit: ZNC 1.7.1 - https://znc.in]
dpg has joined #racket
enderby has quit [Remote host closed the connection]
libertyprime has quit [Ping timeout: 250 seconds]
pera has joined #racket
iyzsong has joined #racket
zmt01 has quit [Quit: Leaving]
libertyprime has joined #racket
dpg has quit [Remote host closed the connection]
acarrico has quit [Ping timeout: 246 seconds]
libertyprime has quit [Ping timeout: 246 seconds]
libertyprime has joined #racket
libertyprime has quit [Ping timeout: 244 seconds]
zmt00 has joined #racket
libertyprime has joined #racket
libertyprime has quit [Ping timeout: 246 seconds]
libertyprime has joined #racket
libertyprime has quit [Ping timeout: 245 seconds]
lockywolf has quit [Read error: Connection reset by peer]
lockywolf has joined #racket
lockywolf has quit [Remote host closed the connection]
lockywolf has joined #racket
<ZombieChicken> apparently someone has written a Lisp in Rust
keep_learning_M has quit [Quit: Leaving]
keep_learning_M has joined #racket
keep_learning_M has quit [Client Quit]
keep_learning_M has joined #racket
pera has quit [Ping timeout: 244 seconds]
<technomancy> is it really a language if no one has written a lisp in it yet?
<ZombieChicken> All languages tend towards a partial, bug-ridden implementaiton of Common Lisp.
orivej has joined #racket
pera has joined #racket
notzmv has quit [Ping timeout: 250 seconds]
notzmv has joined #racket
jao has quit [Ping timeout: 246 seconds]
FreeFull has quit []
_whitelogger has joined #racket
<technomancy> (...including common lisp)
<ZombieChicken> I'd say SBCL seems pretty decent as far as CL implementations go
<ZombieChicken> though honestly I havn't looked at it in probably a year
endformationage has quit [Quit: WeeChat 2.4]
Lowl3v3l has joined #racket
orivej has quit [Ping timeout: 258 seconds]
v88m has quit [Remote host closed the connection]
v88m has joined #racket
pera has quit [Ping timeout: 246 seconds]
v88m has quit [Ping timeout: 245 seconds]
manualcrank has quit [Quit: WeeChat 1.9.1]
sauvin has joined #racket
sauvin has quit [Max SendQ exceeded]
sauvin has joined #racket
lockywolf has quit [Ping timeout: 250 seconds]
ricekrispie has joined #racket
ricekrispie2 has quit [Ping timeout: 258 seconds]
Sgeo_ has quit [Read error: Connection reset by peer]
Sgeo_ has joined #racket
ayerhart has quit [Read error: Connection reset by peer]
soegaard has joined #racket
ayerhart has joined #racket
reverse_light has quit [Ping timeout: 250 seconds]
suppi has quit [Quit: Quit]
lavaflow has quit [Read error: Connection reset by peer]
mSSM has joined #racket
orivej has joined #racket
evdubs has quit [Remote host closed the connection]
evdubs has joined #racket
davidl has joined #racket
orivej has quit [Ping timeout: 246 seconds]
soegaard has quit [Quit: soegaard]
soegaard has joined #racket
lavaflow has joined #racket
Arcaelyx has quit [Ping timeout: 250 seconds]
_whitelogger has joined #racket
Sgeo_ has quit [Read error: Connection reset by peer]
Sgeo_ has joined #racket
johnjay has quit [Read error: Connection reset by peer]
johnjay has joined #racket
YuGiOhJCJ has joined #racket
Fernando-Basso has joined #racket
dimitarvp has joined #racket
dmiles has quit [Ping timeout: 246 seconds]
<rain1> ZombieChicken: I saw that "risp" post but I didn't know how he did allocation/GC
<bremner> I wonder if the fancy ownership semantics in rust helps in writing a GC
dimitarvp has quit [Quit: Bye]
dmiles has joined #racket
johnjay has quit [Ping timeout: 246 seconds]
johnjay has joined #racket
clacke_movim has left #racket [#racket]
lavaflow has quit [Ping timeout: 246 seconds]
_whitelogger has joined #racket
soegaard has joined #racket
soegaard has quit [Quit: soegaard]
jao has joined #racket
soegaard has joined #racket
soegaard has quit [Client Quit]
acarrico has joined #racket
jao has quit [Ping timeout: 250 seconds]
pierpal has quit [Quit: Poof]
pierpal has joined #racket
iyzsong has quit [Read error: Connection reset by peer]
Lowl3v3l has quit [Remote host closed the connection]
vraid has joined #racket
orivej has joined #racket
Fernando-Basso has quit [Remote host closed the connection]
nullman` has joined #racket
Fernando-Basso has joined #racket
pera has joined #racket
orivej has quit [Ping timeout: 250 seconds]
aeth has quit [Ping timeout: 246 seconds]
aeth has joined #racket
endformationage has joined #racket
clacke_movim has joined #racket
badkins has quit [Remote host closed the connection]
endformationage has quit [Ping timeout: 258 seconds]
<samth> bremner: it makes writing a GC hard
<samth> rain1: that post doesn't deal with anything tricky wrt allocation or GC
badkins has joined #racket
manualcrank has joined #racket
badkins has quit [Ping timeout: 250 seconds]
Lowl3v3l has joined #racket
dbmikus_ has joined #racket
selimcan has joined #racket
<selimcan> https://docs.racket-lang.org/brag/ -> page not found
<selimcan> Maaaaaaa perchè tu sei un'altra donna
Fernando-Basso has quit [Remote host closed the connection]
badkins has joined #racket
YuGiOhJCJ has quit [Quit: YuGiOhJCJ]
Arcaelyx has joined #racket
lavaflow has joined #racket
orivej has joined #racket
orivej has quit [Ping timeout: 250 seconds]
johnjay has quit [Quit: WeeChat 2.3]
dbmikus_ has quit [Ping timeout: 268 seconds]
johnjay has joined #racket
dbmikus_ has joined #racket
vraid has quit [Disconnected by services]
efm has joined #racket
vraid has joined #racket
notzmv has quit [Ping timeout: 255 seconds]
Fernando-Basso has joined #racket
notzmv has joined #racket
efm has quit [Ping timeout: 250 seconds]
soegaard has joined #racket
sauvin has quit [Ping timeout: 252 seconds]
ubLIX has joined #racket
ubLIX has quit [Ping timeout: 250 seconds]
acarrico has quit [Ping timeout: 252 seconds]
Arcaelyx has quit [Ping timeout: 255 seconds]
ricekrispie2 has joined #racket
ricekrispie has quit [Ping timeout: 258 seconds]
notzmv has quit [Ping timeout: 244 seconds]
pera has quit [Ping timeout: 255 seconds]
<vraid> i wrote some struct macros a while back to let me do (struct/kw foo (a b)), and then (foo/kw #:b 2 #:a 1) in place of just (foo 1 2). looking back at it, i'd like to replace it with something to let me do (foo/fields [b 2] [a 1]) as it looks a bit cleaner. is there an obvious way to do this? it's been some time since i wrote macros
ubLIX has joined #racket
<vraid> foo/fields would have to be a macro in itself, would it? foo/kw was simply a function accepting keyword arguments
<soegaard> One strategy: Let (foo/fields [b 2] [a 1]) expand to (foo/kw #:b 2 #:a 1)
<vraid> that was my first thought. i'm not sure how to handle field order otherwise
<vraid> it still has to be a macro, right?
<soegaard> Yes.
<soegaard> Otherwise [b 2] is seen as an application.
<vraid> glad i haven't forgotten everything. :)
<vraid> that should be relatively simple, thanks
<friscosam> bremner: There are a few good blog posts about the challenges of making a GC in Rust. https://manishearth.github.io/blog/2015/09/01/designing-a-gc-in-rust/
badkins has quit [Ping timeout: 255 seconds]
<selimcan> do racketeers think that rust is a reasonable guy to be treated with respect?
v88m has joined #racket
Arcaelyx has joined #racket
FreeFull has joined #racket
pera has joined #racket
nullcone has joined #racket
nullcone has left #racket [#racket]
emacsomancer has joined #racket
ubLIX has quit [Quit: ubLIX]
selimcan has quit [Remote host closed the connection]
keep_learning has quit [Ping timeout: 246 seconds]
pierpal has quit [Ping timeout: 244 seconds]
<vraid> soegaard: so i'm giving the macro a (_ id [field value] ...) signature, and the call should be something like #'(constructor (syntax->keyword field) value ...), but i can't quite get the ellipses right
<soegaard> vraid: Try something like (flatten (list ((list syntax->keyword field) value) ...))
<soegaard> You have the same number of fields and values so (list (syntax->keyword field) value)) ... will work (here field and value is paired.
<soegaard> I got the parens wroong before: (flatten (list (list (syntax->keyword field) value) ...)
<vraid> ah, of course. so #'(cons constructor (flatten ...))
<soegaard> Or (apply constructor (flatten ...
mSSM has quit [Ping timeout: 250 seconds]
<vraid> ah yes
lmln_ has joined #racket
efm has joined #racket
<vraid> hmm, next issue is that the call to (struct/fields foo (a b)) should define a foo/fields, which holds a reference to the foo/kw function.. this might be obvious, but how do i easiest capture a variable when creating that macro
<soegaard> Is the macro foo/kw defining foo/fields ?
<vraid> (struct/kw foo (a b)) defines both foo/kw and foo/fields, where (foo/fields [b 2] [a 1]) should expand to (foo/kw #:b 2 #:a 1)
selimcan has joined #racket
efm has quit [Ping timeout: 258 seconds]
<soegaard> If (struct/kw foo (a b)) defines both foo/kw and foo/fields, why is there an struct/fields too?
<vraid> oh, my mistake. struct/kw was the old name, i meant to write struct/fields
<soegaard> ok
<vraid> in essence, (struct/fields ...) is an extension of (struct ...)
<soegaard> If structs/fields are defined them both, then foo/kw is in scope where foo/fields is defined - so things ought to work out of the box.
nullman` has quit [Ping timeout: 245 seconds]
<vraid> struct/fields will return syntax including something like #'(begin (define-syntax foo/fields (syntax-parser ..)) then?
<soegaard> Yes.
<soegaard> But It's probably #'(begin (define-syntax (foo/fields stx) (syntax-parse stx ...
aeth has quit [Ping timeout: 255 seconds]
<vraid> i haven't learned what's what of all these different syntax methods. struct/fields is defined with syntax-parser
<soegaard> Oh! Sorry, missed that one. I knew only about syntax-parse.
selimcan has left #racket ["Leaving"]
aeth has joined #racket
<soegaard> Then your suggestion is fine.
dancek has quit [*.net *.split]
rodlogic has quit [*.net *.split]
<vraid> here's a simplified version, which i'll gladly accept critique on http://pasterack.org/pastes/82619
<vraid> it's giving me an error however, syntax-parser: duplicate attribute in: value, on line 37
<vraid> which is in the definition of foo/fields, (_ id [field value] ...)
v88m has quit [Ping timeout: 246 seconds]
v88m has joined #racket
dieggsy has quit [*.net *.split]
jboy has quit [*.net *.split]
cuyler has quit [*.net *.split]
obfusk has quit [*.net *.split]
<soegaard> This one is tricky: [(_ id [field value] ...)
keep_learning_M has quit [Ping timeout: 255 seconds]
<soegaard> field ... is from struct/fields
<soegaard> but value ... is from constructor/fields
<soegaard> Ah!
<vraid> ah, right. if i rename them i get 'no pattern variables before ellipsis'
<soegaard> I think I know why, but let me test it.
keep_learning_M has joined #racket
acarrico has joined #racket
<soegaard> When a macro defines another macro, it is necessary to specify whether ... is a literal ... or something that repeats from the first macro.
<soegaard> Here is one way to make it a literal ...
<vraid> i can use.. any character for ellipsis? hah
<soegaard> When a macro needs to insert a literal ... one can write (... ...). But that's a bit cumbersone, so I like to give it a name (and yes you decide what to call it).
<vraid> i appreciate the help
<vraid> getting closer, but there are some more errors http://pasterack.org/pastes/40983
<vraid> syntax->keyword is not define now, i'm guessing it only exists at a previous phase?
<soegaard> I think you missed [ooo #'(... ...)]) in the with-syntax.
<soegaard> ooo is just my personal preference.
<vraid> i did indeed
<vraid> though the error remains
<soegaard> What's the test expression?
dancek has joined #racket
rodlogic has joined #racket
jboy has joined #racket
<vraid> s/oh/
<soegaard> Add
<soegaard> (define (syntax->keyword stx)
<soegaard> (string->keyword (symbol->string (syntax->datum stx))))
<soegaard> that is outside the begin-for-syntax
dieggsy has joined #racket
<soegaard> I forgot it's typed/racket in phase 0.
<soegaard> How about:
<soegaard> (: symbol->keyword : Symbol -> Keyword)
<soegaard> (define (symbol->keyword sym)
<soegaard> (string->keyword (symbol->string sym)))
<soegaard> And then use (symbol->keyword 'fld) instead of (syntax->keyword #'fld)
<vraid> much better! even (compose string->keyword symbol->string)
<soegaard> I can't get (apply constructor/kw (flatten ...)) to work though.
<soegaard> Is there a special apply that handles keywords in Typed Racket ?
<vraid> the output of (foo/fields [b 'x] [a 5]) is now '(#<procedure:foo/kw> #:b a #:a 5). not quite there, but it's getting close
<soegaard> change cons to apply
<vraid> Type of argument to apply is not a function type:
<vraid> (-> #:a Integer #:b Symbol foo)
<vraid> that's quite a restrictive definition of function type, i would say
<soegaard> So it's just the types we need to change?
<vraid> isn't that a function type..?
<vraid> #'(apply (λ args args) .. works
niceplace has quit [Ping timeout: 264 seconds]
<vraid> might be something related to the keywords in the function signature
<soegaard> Yes, this
<soegaard> (ann (lambda (kw+field ...)
<soegaard> (id field ...))
<soegaard> (kw+type ... -> id))
<soegaard> should be the moral equivalent of
<soegaard> (ann (lambda (kw+field ...)
<soegaard> (id field ...))
<soegaard> (Any ... -> id))
<soegaard> But since Any is not a pattern variable it can't be followed by an ellipsis.
<vraid> i don't care much for constructor/kw at all. if we could rework it into a helper function for constructor/fields, that'd be even better
niceplace has joined #racket
<vraid> soegaard: it can't be any, since the contract to (id field ...) won't hold then
<soegaard> What kind of contract would work with apply?
<soegaard> Maybe the solution is to annotate the flatten expression.
<soegaard> But I don't know how to do it.
<vraid> ah, the answer was right in front of us :)
<vraid> no apply necessary
<soegaard> great
<soegaard> much simpler
pierpal has joined #racket
<vraid> complete version here, with an example at the bottom http://pasterack.org/pastes/58945
pierpal has quit [Ping timeout: 250 seconds]
<vraid> now this one has a duplicate of (define-syntax constructor/fields, due to two branches of struct/fields; one handling struct super-ids, and one not
<vraid> could the duplication be removed?
orivej has joined #racket
Arcaelyx has quit [Read error: Connection reset by peer]
Arcaelyx has joined #racket
lmln_ has quit [Quit: Connection closed for inactivity]
pierpal has joined #racket
endformationage has joined #racket
soegaard has quit [Quit: soegaard]
rudybot has quit [Ping timeout: 252 seconds]
rudybot has joined #racket