yegods has quit [Read error: Connection reset by peer]
yegods has joined #ocaml
ryanartecona has joined #ocaml
<Drup>
can't really help :/
madroach has quit [Ping timeout: 260 seconds]
madroach has joined #ocaml
lobo has quit [Quit: leaving]
jonludlam has quit [Ping timeout: 276 seconds]
^elyse^ has quit [Quit: Leaving...]
nullcatxxx_ has joined #ocaml
jwatzman|work has quit [Quit: jwatzman|work]
kevinch has joined #ocaml
NingaLeaf has quit [Quit: Leaving]
damason has joined #ocaml
yegods has quit [Read error: Connection reset by peer]
yegods has joined #ocaml
NingaLeaf has joined #ocaml
NingaLeaf has quit [Client Quit]
Guest38 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
NingaLeaf has joined #ocaml
ryanartecona has quit [Quit: ryanartecona]
yegods has quit [Read error: Connection reset by peer]
yegods_ has joined #ocaml
badon has quit [Disconnected by services]
badon_ has joined #ocaml
badon_ is now known as badon
shinnya has joined #ocaml
yegods has joined #ocaml
yegods_ has quit [Read error: Connection reset by peer]
kevinch has quit [Quit: Computer has gone to sleep.]
<coody>
What's the preferred way to create a mapping between a variant and ints? A map? Pattern matching (which would mean I'd have to type it out twice?)? Something else?
FreeBirdLjj has joined #ocaml
pierpa` has joined #ocaml
yegods_ has joined #ocaml
yegods has quit [Read error: Connection reset by peer]
kushal has joined #ocaml
fluter has quit [Ping timeout: 240 seconds]
fluter has joined #ocaml
ceryo has joined #ocaml
ceryo has quit [Ping timeout: 276 seconds]
igoroliveira has quit [Quit: Connection closed for inactivity]
ceryo has joined #ocaml
Algebr has joined #ocaml
Algebr has quit [Remote host closed the connection]
<mahem1_>
coody: Just straight forward partern matching?
<mahem1_>
But honestly it really doesn't matter what you do just as long it is only done once in a function, right?
yegods_ has quit [Remote host closed the connection]
ceryo_ has joined #ocaml
ceryo_ has quit [Client Quit]
zv has joined #ocaml
ceryo has quit [Ping timeout: 255 seconds]
ryanartecona has joined #ocaml
Algebr has joined #ocaml
kevinch has joined #ocaml
<coody>
mahem1_: I need to do the conversion in both directions, but I don't want to write it out twice
yegods has joined #ocaml
yegods has quit [Remote host closed the connection]
<mahem1_>
coody: Well, in that case I guess you could just have a original (variant * int) list and dynamically (runtime) create the complementing (int * variant) list.
<mahem1_>
Though if lists are too hard to work with a Hashtbl would suffice.
fluter has quit [Quit: WeeChat 1.2]
fluter has joined #ocaml
<mahem1_>
Or a map.
nuuit has quit [Ping timeout: 265 seconds]
<coody>
I see
shinnya has quit [Ping timeout: 264 seconds]
nullcatxxx_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
nullcatxxx_ has joined #ocaml
infinity0 has quit [Remote host closed the connection]
pyon has joined #ocaml
infinity0 has joined #ocaml
moei has quit [Quit: Leaving...]
moei has joined #ocaml
ygrek has quit [Ping timeout: 240 seconds]
systmkor has quit [Ping timeout: 272 seconds]
Algebr has quit [Ping timeout: 240 seconds]
kevinch has quit [Quit: Computer has gone to sleep.]
kevinch has joined #ocaml
ryanartecona has quit [Quit: ryanartecona]
vishesh has quit [Quit: WeeChat 1.1.1]
vishesh has joined #ocaml
nullcatxxx_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
nullcatxxx_ has joined #ocaml
damason has quit [Ping timeout: 264 seconds]
mac10688 has quit [Ping timeout: 264 seconds]
teknozulu has joined #ocaml
darkf has joined #ocaml
Mercuria1Alchemi has joined #ocaml
psy_ has quit [Remote host closed the connection]
contempt has quit [Remote host closed the connection]
Mercuria1Alchemi has quit [Ping timeout: 276 seconds]
kevinch has quit [Quit: Computer has gone to sleep.]
contempt has joined #ocaml
rand has joined #ocaml
NingaLeaf has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
kushal has quit [Ping timeout: 260 seconds]
kushal has joined #ocaml
teknozulu has quit [Ping timeout: 276 seconds]
pierpa` has quit [Ping timeout: 246 seconds]
python476 has joined #ocaml
coody has quit [Quit: Connection closed for inactivity]
ygrek has joined #ocaml
Simn has joined #ocaml
bbc has left #ocaml ["Quit"]
nullcatxxx_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
freehck has quit [Remote host closed the connection]
freehck has joined #ocaml
rand has quit [Quit: leaving]
jccnd has quit [Quit: jccnd]
sh0t has joined #ocaml
Haudegen has quit [Ping timeout: 240 seconds]
orbifx has joined #ocaml
Haudegen has joined #ocaml
sh0t has quit [Ping timeout: 260 seconds]
jeffmo has quit [Quit: jeffmo]
yegods has joined #ocaml
larhat has quit [Quit: Leaving.]
yegods has quit [Remote host closed the connection]
<orbifx>
hello #ocaml
jonludlam has joined #ocaml
jonludlam has quit [Ping timeout: 265 seconds]
marynate has quit [Ping timeout: 272 seconds]
<orbifx>
s
marynate has joined #ocaml
yegods has joined #ocaml
yegods has quit [Remote host closed the connection]
zpe has joined #ocaml
agumonkey has quit [Ping timeout: 260 seconds]
mort___ has joined #ocaml
python476 has quit [Ping timeout: 246 seconds]
python476 has joined #ocaml
Kakadu has joined #ocaml
samuel02 has joined #ocaml
marynate has quit [Ping timeout: 276 seconds]
marynate has joined #ocaml
samuel02 has quit []
mort___ has quit [Quit: Leaving.]
Bahman has joined #ocaml
raphaelss has joined #ocaml
yegods has joined #ocaml
FreeBird_ has joined #ocaml
yegods has quit [Remote host closed the connection]
AltGr has left #ocaml [#ocaml]
FreeBirdLjj has quit [Ping timeout: 272 seconds]
FreeBird_ has quit [Ping timeout: 272 seconds]
ocp has joined #ocaml
<Bahman>
`List` is a persistent list, right?
<dmbaturin>
Bahman: Yes, it's immutable.
<Bahman>
dmbaturin: Indulge me, but immutable and persistent, right? :-)
<dmbaturin>
Bahman: What is your definition of persistent? :)
<Bahman>
dmbaturin: Imagine `let foolist = [1;2] in let barlist = (3 :: foolist) in ... `
<Bahman>
A persistent list impl, wouldn't make `barlist` a list of size 3 in memory. Instead it uses the data alread in `foolist` and creates a new list with a head=3 and tail pointing to `foolist`.
<Bahman>
I hope that makes sense :-)
<dmbaturin>
Yes, making a new list keeps previous versions intact and uses structural sharing.
<Bahman>
Ah...excellent. Thanks dmbaturin.
<dmbaturin>
Bahman: Most commonly I see 'fully persistent' defined as 'all previous versions remains accessible', but it doesn't really say anything about structural sharing. :)
ygrek has quit [Ping timeout: 240 seconds]
ddosia has joined #ocaml
<Bahman>
dmbaturin: Reading the Wikipedia page on the topic...I'm surprised I didn't do that earlier...you're right.
<Bahman>
The structural sharing thing is a bonus but not a necessity.
<Bahman>
You see, I did this immutable List impl in Java...it worked as expected...except that the performance and memory consumption was awful :-)
<Bahman>
Java's lists do not share structure and I didn't do that either.
<Bahman>
Hence my sensitivity to the topic.
<dmbaturin>
Bahman: Python tuples are also immutable (as in you can't modify it), but apparently use full copying.
<Bahman>
Yes...that's exactly what I did with my lists.
<Bahman>
Clojure's lists are persistent with structural sharing.
<Bahman>
Other Schemes, I guess, don't do this.
<Bahman>
Thanks for the assist.
infinity0 has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
infinity0 has joined #ocaml
osheeta has joined #ocaml
dsheets has joined #ocaml
dsheets has quit [Client Quit]
dsheets has joined #ocaml
kushal has quit [Ping timeout: 240 seconds]
igoroliveira has joined #ocaml
yegods has joined #ocaml
yegods has quit [Remote host closed the connection]
marynate has quit [Ping timeout: 260 seconds]
mort___ has joined #ocaml
metadave has quit [Quit: Connection closed for inactivity]
NingaLeaf has joined #ocaml
charpi has quit [Remote host closed the connection]
fluter has quit [Ping timeout: 272 seconds]
freehck has quit [Ping timeout: 240 seconds]
fluter has joined #ocaml
python476 has quit [Ping timeout: 246 seconds]
python476 has joined #ocaml
fluter has quit [Ping timeout: 252 seconds]
yegods has joined #ocaml
fluter has joined #ocaml
kushal has joined #ocaml
NingaLeaf has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
BitPuffin has joined #ocaml
infinity0 has quit [Remote host closed the connection]
agumonkey has joined #ocaml
infinity0 has joined #ocaml
Haudegen has quit [Ping timeout: 264 seconds]
yegods has quit [Remote host closed the connection]
ceryo has joined #ocaml
zpe has quit [Remote host closed the connection]
freehck has joined #ocaml
coody has joined #ocaml
Haudegen has joined #ocaml
ryanartecona has joined #ocaml
fluter has quit [Ping timeout: 272 seconds]
AlexRussia has joined #ocaml
ryanartecona has quit [Quit: ryanartecona]
BitPuffin has quit [Read error: Connection reset by peer]
BitPuffin has joined #ocaml
yegods has joined #ocaml
yegods has quit [Remote host closed the connection]
dsheets has quit [Ping timeout: 272 seconds]
yegods has joined #ocaml
fluter has joined #ocaml
yegods has quit [Remote host closed the connection]
dsheets has joined #ocaml
yegods has joined #ocaml
pierpa` has joined #ocaml
mthom``` has joined #ocaml
yegods has quit [Remote host closed the connection]
mthom`` has quit [Read error: Connection reset by peer]
raphaelss has quit [Remote host closed the connection]
sepp2k has joined #ocaml
yegods has joined #ocaml
<Leonidas>
dmbaturin: Python tuples are usually rather tiny with just a couple of elements and usually not modified (as in, appending or deleting items), so I don't think implementing structural sharing would be an advantage.
Haudegen has quit [Remote host closed the connection]
ceryo_ has joined #ocaml
zpe has joined #ocaml
ceryo has quit [Ping timeout: 240 seconds]
<Drup>
also, memory sharing would add indirections and kill locality.
cow-orke1 has quit [Ping timeout: 240 seconds]
<dmbaturin>
Leonidas: Well, true, I think it's still a good example of complicated relationships between immutability, persistence, and sharing.
cow-orker has joined #ocaml
<Leonidas>
absolutely!
ceryo has joined #ocaml
cow-orker has quit [Ping timeout: 240 seconds]
ceryo_ has quit [Ping timeout: 255 seconds]
OnkV has joined #ocaml
cow-orker has joined #ocaml
cow-orker has quit [Ping timeout: 240 seconds]
cow-orker has joined #ocaml
shinnya has joined #ocaml
ohama has quit [Ping timeout: 244 seconds]
ohama has joined #ocaml
Kakadu has quit [Ping timeout: 246 seconds]
MercurialAlchemi has quit [Ping timeout: 264 seconds]
BitPuffin is now known as KHAAAAAAN
octachron has joined #ocaml
kevinch has joined #ocaml
ryanartecona has joined #ocaml
<orbifx>
I just realised that despite the name, Ocaml doesn't use CamelCase!
<theblatte>
but it does... it's OCaml!
<theblatte>
can opam tell me which "switch" it's currently using?
<Drup>
opam sw sh
<theblatte>
I would like to save it somewhere, then `opam switch <other version>`, do stuff, then `opam switch <previous version>`, but I don't know how to get <previous version>
<theblatte>
Drup: yay, thanks! :)
<Drup>
(you can see that I use it often, because I minimized the chars :D)
<edwin>
opam config exec --switch=foo -- cmd ...
<Drup>
but yeah, for your use case; you don't even need to switch
<Drup>
just do what edwin said
<edwin>
depends what you want to run, if its other opam commands not sure if opam config exec works, but for building stuff/running apps its fine
<theblatte>
well I need to do a bunch of things, but maybe I can put them in yet another script...
<theblatte>
I need to opam install some stuff, then run a bunch of compilation commands
<Drup>
theblatte: in this case, just eval `opam config env --switch FOO`
<Drup>
it will switch locally in the given shell without switching globally
<orbifx>
dmbaturin: yeah I know. Just messing. OCaml seems to have the right amount of camel case and at the right places. Doing some QML now and camel casing everywhere is dizzying
<Drup>
The only lovable CamelCase is the BatConvention
<dmbaturin>
orbifx: How's your config management project going?
<orbifx>
not too far yet I'm doing some passwd management now
<orbifx>
just to get a version finished
<orbifx>
after that I will look into a more generalised approach at which point we can work together on something.
<orbifx>
something complex, convoluted and generally 1337 :P