samth changed the topic of #racket to: Racket v7.8 has been released: https://blog.racket-lang.org/2020/08/racket-v7-8.html -- Racket -- https://racket-lang.org -- https://pkgs.racket-lang.org -- Paste at http://pasterack.org
greghendershott has joined #racket
sagax has quit [Quit: Konversation terminated!]
rj_ has joined #racket
juanfra_ has quit [Ping timeout: 256 seconds]
juanfra has joined #racket
dhil has quit [Ping timeout: 240 seconds]
Diagon has joined #racket
rj_ has quit [Ping timeout: 240 seconds]
Diagon has left #racket ["Leaving"]
endobson has joined #racket
evdubs_ has joined #racket
evdubs has quit [Ping timeout: 264 seconds]
endobson has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
endobson has joined #racket
Fare has quit [Ping timeout: 264 seconds]
Fare has joined #racket
aaaaaa has quit [Ping timeout: 240 seconds]
evdubs_ is now known as evdubs
caente has quit [Quit: KVIrc 5.0.0 Aria http://www.kvirc.net/]
nullcone has joined #racket
lfanew has joined #racket
Fare has quit [Ping timeout: 264 seconds]
narimiran has joined #racket
rmnull has joined #racket
endformationage has quit [Quit: WeeChat 2.9]
srandon111 has joined #racket
rmnull has quit [Quit: WeeChat 3.0]
fredmanglis has joined #racket
greghendershott has quit [Quit: Connection closed for inactivity]
dan_f has joined #racket
dmiles has quit [Ping timeout: 240 seconds]
phillbush has quit [Quit: Leaving]
sagax has joined #racket
andreyorst` has joined #racket
bitmapper has quit [Quit: Connection closed for inactivity]
dan_f has quit [Quit: dan_f]
dan_f has joined #racket
dan_f has quit [Client Quit]
andreyorst` has quit [Quit: andreyorst`]
andreyorst` has joined #racket
orivej has joined #racket
gpanders has quit [Ping timeout: 256 seconds]
gpanders has joined #racket
libertyprime has joined #racket
lfanew has quit [Remote host closed the connection]
nullcone has quit [Quit: Connection closed for inactivity]
Sgeo has quit [Read error: Connection reset by peer]
endobson has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
srandon111 has quit [Ping timeout: 260 seconds]
<yurb> Hi everyone. I'm trying to write a macro that will define two functions (with syntax-parse)
<yurb> I'm getting "begin (possibly implicit): no expression after a sequence of internal definitions"
<yurb> I'm missing something very basic
endobson has joined #racket
<yurb> Hm, nvm the error; there's another issue: the declarations are not visible: http://pasterack.org/pastes/82059
<yurb> i.e., doing (the-first) in REPL errors with ; the-first: undefined;
<yurb> In DrRacket's macro stepper I see it's being transformed to `(begin (define (the-first) 1) (define (the-second) 2)`
<yurb> * In DrRacket's macro stepper I see it's being transformed to `(begin (define (the-first) 1) (define (the-second) 2))`
aaaaaa has joined #racket
fredmanglis has quit [Ping timeout: 260 seconds]
DGASAU has joined #racket
fredmanglis has joined #racket
dmiles has joined #racket
thallada has quit [Quit: WeeChat 2.4]
<dzoe> yurb: either you have to make your macro a bit unhygienic or pass on the function names (that way you keep it hygienic)
<dzoe> samth: did the pasterack's notify function ever ... functioned? ;)
<dzoe> (don't know who else to ask, it's either you or I assume you know who is in charge there)
endobson has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
aaaaaa has quit [Ping timeout: 256 seconds]
<yurb> dzoe: thanks a lot!
ridik has joined #racket
phillbush has joined #racket
<yurb> Another (philosophical?) question - is there something like `dict-ref` (or python's `getattr`) for struct?
<yurb> For polymorphic access of struct fields
<yurb> Also iteration on struct fields in the form similar to (for ([(k v) (in-hash ...)]) ...)
<yurb> ...where I would get the field name and value
<yurb> Currently I'm tempted to implement something like (struct model (fields data)) where the data would be a simple hash
<yurb> Maybe implement the gen:dict https://docs.racket-lang.org/reference/dicts.html?q=gen%3Adict#%28form._%28%28lib._racket%2Fdict..rkt%29._gen~3adict%29%29
<yurb> Or more generally, I know there is some metadata stored about structs, but I'm don't understand how to access it (like list of field names?) file:///nix/store/ap2i3mlrqbxgjn8qvls9dv11kkq4havp-racket-7.8/share/doc/racket/reference/structinfo.html?q=structure%20type
dhil has joined #racket
<dzoe> yurb: you can access the struct elements using their index number and you should be able to get the index number - but I would have to look it up
libertyprime has quit [Remote host closed the connection]
jnb has joined #racket
<yurb> Get the index number knowing the field name? Can you give me a hint where to look for that?
Fare has joined #racket
notzmv has quit [Ping timeout: 265 seconds]
TCZ has joined #racket
sagax has quit [Read error: Connection reset by peer]
caente has joined #racket
orivej has quit [Ping timeout: 256 seconds]
<samth> dzoe: pasterack is by stchang, who I don't think is on irc these days
<samth> yurb: dzoe: no, there's no way to treat structs as dictionaries. in some cases, you could use reflection, but the field names are not available at runtime at all
<dzoe> Ah, you are right, te struct-field-index is syntax only within struct form... OTOH it should be fairly easy to wrap struct form into some generic definition, that stores the map between symbols and indices for later use.
<dzoe> samth: Well, some introspection is available using define-namespace-anchor, namespace-anchor->namespace, namespace-symbols and some further trickery.
<dzoe> Trouble is that you need the struct definition at least somewhere. If you just get an opaque value, no reflection for you.
<yurb> I think I should use hashes more often than structs probably
Sgeo has joined #racket
notzmv has joined #racket
endformationage has joined #racket
bitmapper has joined #racket
orivej has joined #racket
andreyorst` has quit [Quit: andreyorst`]
andreyorst has joined #racket
sagax has joined #racket
narimiran has quit [Ping timeout: 256 seconds]
narimiran has joined #racket
endobson has joined #racket
fredmanglis has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
Mrbuck has joined #racket
<Mrbuck> hi
endobson has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
TCZ has quit [Remote host closed the connection]
aaaaaa has joined #racket
ben_m has joined #racket
aeth_ has joined #racket
aeth has quit [Disconnected by services]
aeth_ is now known as aeth
TCZ has joined #racket
andreyorst has quit [Ping timeout: 260 seconds]
phillbush has quit [Quit: Leaving]
ArneBab has joined #racket
narimiran has quit [Ping timeout: 256 seconds]
nullcone has joined #racket
gpanders has quit [Quit: ZNC - https://znc.in]
aeth has quit [Ping timeout: 246 seconds]
aeth has joined #racket
ArneBab has quit [Remote host closed the connection]
Blkt has quit [Ping timeout: 272 seconds]
Blkt has joined #racket
dustyweb has joined #racket
Mrbuck has quit [Quit: WeeChat 2.9]
ridik has quit [Quit: Leaving]
ermo has quit [Quit: ZNC 1.8.2 - https://znc.in]
ermo has joined #racket
aeth_ has joined #racket
aeth has quit [Disconnected by services]
aeth_ is now known as aeth
sagax has quit [Remote host closed the connection]
TCZ has quit [Quit: Diabe? tkwi w szczegó?ach]
phillbush has joined #racket
dhil has quit [Ping timeout: 272 seconds]