pera has joined #racket
pierpal has quit [Remote host closed the connection]
ziyourenxiang has joined #racket
ubLIX has quit [Quit: ubLIX]
X-Scale has quit [*.net *.split]
Bunogi has quit [*.net *.split]
friscosam has quit [*.net *.split]
cpup has quit [*.net *.split]
dieggsy has quit [*.net *.split]
[o__o] has quit [*.net *.split]
JStoker has quit [*.net *.split]
ecraven has quit [*.net *.split]
iclon has quit [*.net *.split]
tfb has quit [*.net *.split]
GreaseMonkey has quit [*.net *.split]
epony has quit [*.net *.split]
SenasOzys has quit [*.net *.split]
orivej has quit [*.net *.split]
g00s has quit [*.net *.split]
eagleflo has quit [*.net *.split]
lavaflow has quit [*.net *.split]
mfiano has quit [*.net *.split]
mr_yogurt has quit [*.net *.split]
davidl has quit [*.net *.split]
FreeFull has quit [*.net *.split]
gabot has quit [*.net *.split]
DGASAU has quit [*.net *.split]
crsc has quit [*.net *.split]
ski has quit [*.net *.split]
dvdmuckle has quit [*.net *.split]
keep_learning has quit [*.net *.split]
thallada has quit [*.net *.split]
gonz_ has quit [*.net *.split]
jhei has quit [*.net *.split]
dustyweb has quit [*.net *.split]
nckx has quit [*.net *.split]
fridim has quit [*.net *.split]
nisstyre has quit [*.net *.split]
asumu has quit [*.net *.split]
siel has quit [*.net *.split]
rain2 has quit [*.net *.split]
greghendershott has quit [*.net *.split]
banjiewen has quit [*.net *.split]
peddie1 has quit [*.net *.split]
paulharris has quit [*.net *.split]
jackhill has quit [*.net *.split]
zeeshanlakhani has quit [*.net *.split]
aidalgol has quit [*.net *.split]
jrslepak has quit [*.net *.split]
pera has quit [*.net *.split]
zigpaw has quit [*.net *.split]
reverse_light has quit [*.net *.split]
cefalcox has quit [*.net *.split]
_whitelogger has joined #racket
emma_ has quit [Quit: leaving]
badkins_ has quit [Remote host closed the connection]
Sgeo has joined #racket
Sgeo_ has quit [Ping timeout: 268 seconds]
nckx has joined #racket
pera has quit [Ping timeout: 268 seconds]
dented42 has joined #racket
skangas has quit [Quit: Leaving]
pera has joined #racket
libertyprime has joined #racket
pera has quit [Ping timeout: 245 seconds]
lavaflow has quit [Read error: Connection reset by peer]
lavaflow has joined #racket
lockywolf has joined #racket
_whitelogger has joined #racket
tautologico has quit [Quit: Connection closed for inactivity]
lockywolf has quit [Ping timeout: 250 seconds]
_whitelogger has joined #racket
kPb_in has joined #racket
libertyprime has quit [Ping timeout: 252 seconds]
_whitelogger has joined #racket
Lowl3v3l has joined #racket
libertyprime has joined #racket
kPb_in has quit [Quit: kPb_in]
kPb_in has joined #racket
orivej has quit [Ping timeout: 252 seconds]
orivej has joined #racket
qeval has quit [Remote host closed the connection]
tilpner has quit [Remote host closed the connection]
libertyprime has quit [Ping timeout: 244 seconds]
libertyprime has joined #racket
tilpner has joined #racket
kPb_in has quit [Quit: kPb_in]
libertyprime has quit [Ping timeout: 252 seconds]
kPb_in has joined #racket
kPb_in has quit [Quit: kPb_in]
kPb_in has joined #racket
evdubs has quit [Remote host closed the connection]
evdubs has joined #racket
tfb has quit [Read error: Connection reset by peer]
tfb has joined #racket
JStoker has quit [Ping timeout: 252 seconds]
ecraven has quit [Ping timeout: 252 seconds]
GreaseMonkey has quit [Remote host closed the connection]
fridim has quit [Ping timeout: 252 seconds]
fridim has joined #racket
ecraven has joined #racket
JStoker has joined #racket
orivej has quit [Ping timeout: 244 seconds]
fridim has quit [Ping timeout: 252 seconds]
fridim has joined #racket
pera has quit [Ping timeout: 250 seconds]
dented42 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kPb_in has quit [Quit: kPb_in]
tomaw- is now known as tomaw
ZombieChicken has joined #racket
libertyprime has joined #racket
pie_ has joined #racket
mzan has joined #racket
vraid has joined #racket
kPb_in has joined #racket
dented42 has joined #racket
dented42 has quit [Ping timeout: 268 seconds]
<libertyprime> any plans to preserve the logs for #racket when botbot.me shuts down?
Falacer has joined #racket
kPb_in has quit [Quit: kPb_in]
dented42 has joined #racket
kPb_in has joined #racket
dan_f has quit [Quit: dan_f]
dented42 has quit [Ping timeout: 246 seconds]
ubLIX has joined #racket
kPb_in has quit [Quit: kPb_in]
dan_f has joined #racket
dented42 has joined #racket
kPb_in has joined #racket
dan_f has quit [Quit: dan_f]
orivej has joined #racket
dan_f has joined #racket
dan_f has quit [Client Quit]
dan_f has joined #racket
dented42 has quit [Ping timeout: 252 seconds]
kPb_in has quit [Quit: kPb_in]
orivej has quit [Ping timeout: 268 seconds]
kPb_in has joined #racket
orivej has joined #racket
kPb_in has quit [Quit: kPb_in]
vraid has quit [Disconnected by services]
vraid has joined #racket
dented42 has joined #racket
dan_f has quit [Quit: dan_f]
bremner has quit [Quit: Coyote finally caught me]
dan_f has joined #racket
bremner has joined #racket
ubLIX has quit [Quit: ubLIX]
dan_f has quit [Quit: dan_f]
dan_f has joined #racket
dented42 has quit [Ping timeout: 252 seconds]
ZombieChicken has quit [Quit: Have a nice day]
kPb_in has joined #racket
epony has quit [Quit: QUIT]
epony has joined #racket
dan_f_ has joined #racket
dan_f has quit [Quit: dan_f]
dan_f_ is now known as dan_f
Lowl3v3l has quit [Read error: Connection reset by peer]
Lowl3v3l has joined #racket
<rntz> if I want to write some code in racket that's parameterizes over an ordering on a given type - for example, to implement a generic min-heap
<rntz> is there a standard way to go about that?
<rntz> I could shove the comparison function into the data structure (the min heap), but that's ugly (and inhibits inlining if Racket does inlining)
<rntz> I could write the whole thing inside a function parameterized over the comparison function, but then how do I export my various methods in a usable fashion?
<rntz> I could use units, maybe. units seem not much used in Racket.
Lowl3v3l has quit [Remote host closed the connection]
Lowl3v3l has joined #racket
epony has quit [Quit: QUIT]
<rntz> I could also make a generic interface for comparison, I guess? does one of those exist already?
<rntz> (I have zero idea how to reason about their performance)
dented42 has joined #racket
Oxyd has joined #racket
epony has joined #racket
dan_f has quit [Quit: dan_f]
dan_f has joined #racket
dan_f has quit [Client Quit]
dan_f has joined #racket
dustyweb has joined #racket
audriu has joined #racket
ubLIX has joined #racket
X-Scale has joined #racket
iyzsong has joined #racket
dented42 has quit [Ping timeout: 246 seconds]
kPb_in has quit [Quit: kPb_in]
sleepnap has joined #racket
vraid has quit [Quit: Page closed]
badkins has joined #racket
Lowl3v3l has quit [Quit: Leaving.]
dented42 has joined #racket
iyzsong has quit [Quit: ZNC 1.7.1 - https://znc.in]
dan_f has quit [Quit: dan_f]
mzan has quit [Ping timeout: 246 seconds]
massimo_zaniboni has joined #racket
sleepnap has quit [Ping timeout: 250 seconds]
dented42 has quit [Ping timeout: 245 seconds]
sleepnap has joined #racket
Falacer has quit [Ping timeout: 252 seconds]
pera has joined #racket
Falacer has joined #racket
eMBee has joined #racket
dan_f has joined #racket
<tonyg> rntz: it's not particularly performant IIRC
<tonyg> rntz: I've usually resorted to putting an ordering in the root of such parameterized data structures. It's definitely not non-ugly. It will probably not inhibit much inlining, but I don't know the details on what Racket does wrt inlining these days. My understanding has been it's mostly compile-time inlining and no run-time inlining at all.
dan_f has quit [Quit: dan_f]
<rntz> tonyg: hm, thanks.
<rntz> I think putting the ordering into the data structure itself really isn't an option for me, since I want a immutable interface with (e.g.) a "union" method, and there's no sense in unioning two heaps if they have different orderings. it's really the min-heap methods that are parameterised by the ordering, not a particular heap data structure.
<rntz> I think for now I'll just... not try to make a generic min-heap :P. I only have one use-case in mind, so I'll just specialise it. it's not a whole lot of code.
dented42 has joined #racket
massimo_zaniboni has quit [Quit: Leaving.]
dan_f has joined #racket
Falacer has quit [Quit: leaving]
dented42 has quit [Ping timeout: 245 seconds]
mwnaylor has joined #racket
dan_f has quit [Quit: dan_f]
<tonyg> rntz: isn't the invariant parameterized by the ordering too?
<tonyg> rntz: but yes, checking `eq?` or similar of the ordering is def necessary outside of typeish approaches
sauvin has quit [Remote host closed the connection]
dan_f has joined #racket
pie_ has quit [Ping timeout: 268 seconds]
<rain2> you need parametrized modules
<rain2> maybe you could simulate it using a dynamic binding, or a macro that defines a module given a comparator
SenasOzys has joined #racket
dented42 has joined #racket
orivej has quit [Ping timeout: 252 seconds]
badkins has quit [Remote host closed the connection]
pera has quit [Ping timeout: 245 seconds]
dented42 has quit [Ping timeout: 268 seconds]
pera has joined #racket
libertyprime has quit [Ping timeout: 245 seconds]
<samth> rntz: why is that constraint with the ordering in the data structure?
<samth> can't you just check if two things have the same ordering, and error if not?
badkins has joined #racket
orivej has joined #racket
audriu has quit [Remote host closed the connection]
ubLIX has quit [Quit: ubLIX]
dan_f has quit [Quit: dan_f]
badkins has quit [Ping timeout: 252 seconds]
dan_f has joined #racket
dented42 has joined #racket
mzan has joined #racket
badkins has joined #racket
dan_f has quit [Quit: dan_f]
DGASAU has quit [Read error: Connection reset by peer]
DGASAU has joined #racket
dan_f has joined #racket
pie_ has joined #racket
isomorphismes has joined #racket
libertyprime has joined #racket
dented42 has quit [Ping timeout: 246 seconds]
ZombieChicken has joined #racket
sleepnap has left #racket [#racket]
ephemera_ has quit [Read error: Connection reset by peer]
dented42 has joined #racket
acarrico has quit [Ping timeout: 252 seconds]
ubLIX has joined #racket
dented42 has quit [Ping timeout: 252 seconds]
dented42 has joined #racket
ubLX has joined #racket
ubLIX has quit [Ping timeout: 252 seconds]
ubLX is now known as ubLIX
mejja has joined #racket
<rntz> samth: well, I could check if the orderings are equal?, sure. but you can't _really_ test orderings for equality (they're functions, which do not admit decidable equality). anytime I need to do that I feel like the universe is telling me to find another way :P.
<samth> rntz: I think the universe is telling you to use equal? on the ordering functions
<rntz> I think the "right" solution for my particular sensibilities about code would be to use units. but I haven't bothered to learn units.
<samth> rntz: that doesn't really offer any abstraction capabilities that aren't there with functions
<lexi-lambda> I believe samth has said in the past something along the lines of “I don’t think you ever want to use units” :)
<samth> that is, the questions about ordering and comparability are still there
<lexi-lambda> but this could be apocryphal…
<rntz> sure. but it lets me parameterize a whole group of named things by an argument. I could also write a function returning a module, I guess?
pera has quit [Quit: leaving]
<rntz> I don't know whether modules can be passed around as first-class things, but I assume they can.
<samth> you could write a function returning some functions
<samth> maybe by putting them in a list
<samth> units are that + recursive knot typing + complexity
<samth> ;)
<lexi-lambda> units do make it easier to get the names right if you have a *lot* of names, via the inferred linking
<rntz> well, I have exactly one name being imported (a comparison function) and many being exported.
<samth> my point is not really about units, but that the questions about comparison operators don't go away when you use units
<rntz> I'm not sure what question about comparison operators you're referring to?
<lexi-lambda> I think this is a pretty canonical example of ML modules, isn’t it? I could see the usefulness of units here. imo Racket is really bad, idiomatically, at this kind of parameterization/polymorphism
<rntz> the point is that units (iiuc) let me parameterize a whole bunch of definitions by some functions. just like writing a function that returns a list of other functions would do. they're equivalent in that sense.
<rntz> yeah, this is definitely a thing modules do nicely. as do typeclasses.
<rntz> er, where modules=ML modules
<lexi-lambda> right, but typeclasses need types
dented42 has quit [Ping timeout: 246 seconds]
<rntz> sure. although for many use-cases (including this one) some sort of dynamic dispatch will also get you there. which is why I could also use generic interfaces or whatever things like gen:eq+hash are called.
<samth> rntz: what I'm saying is that the questions about what happens if you union two sets with different comparators doesn't go away
<samth> rntz: units make it relatively easy to give an error in that case
<lexi-lambda> I think racket/generic makes it hard to enforce the coherence guarantee you need in this case
<rntz> wait. you say that the question doesn't go away, and then you say that it makes it easy to give an error? doesn't making it easy to make that an error make the question go away? :P
<rntz> lexi-lambda: hm, you mean that (compare x y) is the inverse of (compare y x)?
<lexi-lambda> no, I mean that each structure only holds one “type” of thing, and therefore the comparators are consistent
<lexi-lambda> typeclass coherence gets you this for free, and module generativity does, too, but other approaches do not necessarily make that easy
<rntz> I think we're saying the same thing? Namely, I think "the comparators are consistent" comes down to (compare x y) always being the inversion of (compare y x) - i.e. that _which_ of x,y you dispatch on doesn't make a difference. if x,y have different hypothetical gen:compare instances, there's no guarantee this will be true.
<rntz> this is one of the issues with Python's __cmp__ magic method
<lexi-lambda> oh, I see, I thought you were referring to the more specific property of those two being consistent within a single comparator
<rntz> ah, yeah. well, yes, people can always write incorrect code. not much to be done about that.
<lexi-lambda> anyway, yes, I have no idea how you’d enforce that consistency with racket/generic
<rntz> doesn't this problem already arise with gen:eq+hash?
dan_f has quit [Quit: dan_f]
<lexi-lambda> now that you mention it, I’m not actually sure how equal? enforces that both values are the same type. I wonder if it checks that the prop:equal+hash values are the same, or if it actually checks that the structure types are themselves the same.
<lexi-lambda> rntz: it looks like equal?’s implementation in C does some magic to ensure the structures have the same type, though I guess you could do something similar by using `struct-info` and bailing if your inspector is not powerful enough.
orivej has quit [Ping timeout: 244 seconds]
Sgeo has quit [Quit: Leaving]
Sgeo has joined #racket
SenasOzys has quit [Remote host closed the connection]
SenasOzys has joined #racket
dented42 has joined #racket
dented42 has quit [Ping timeout: 252 seconds]
dented42 has joined #racket
Guest88437 has joined #racket
X-Scale has quit [Ping timeout: 252 seconds]
keep_learning has quit [Ping timeout: 252 seconds]