flux changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | OCaml 4.01.0 http://bit.ly/1851A3R | http://www.ocaml.org | Public logs at http://tunes.org/~nef/logs/ocaml/
kyrylo has quit [Ping timeout: 252 seconds]
osa1 has joined #ocaml
Simn has quit [Quit: Leaving]
mcclurmc has joined #ocaml
talzeus_ has quit [Read error: Connection reset by peer]
mcclurmc has quit [Remote host closed the connection]
mcclurmc has joined #ocaml
mcclurmc has quit [Remote host closed the connection]
cesar_ has joined #ocaml
cesar_ is now known as Guest68001
yminsky has joined #ocaml
ygrek has joined #ocaml
Eyyub has quit [Ping timeout: 264 seconds]
mcclurmc has joined #ocaml
Guest68001 has quit [Remote host closed the connection]
mfp has quit [Read error: Operation timed out]
csakatoku has joined #ocaml
talzeus_ has joined #ocaml
nikki93 has joined #ocaml
Neros has joined #ocaml
yminsky has quit [Quit: yminsky]
Xenasis has quit [Remote host closed the connection]
strobegen has joined #ocaml
yminsky has joined #ocaml
cesar_ has joined #ocaml
cesar_ is now known as Guest10797
Guest10797 has quit [Remote host closed the connection]
dsheets has quit [Ping timeout: 245 seconds]
boogie has quit [Remote host closed the connection]
shinnya has quit [Ping timeout: 272 seconds]
w0rm_x has joined #ocaml
w0rm_x has left #ocaml []
yminsky has quit [Quit: yminsky]
yminsky has joined #ocaml
platypine has quit [Ping timeout: 246 seconds]
yminsky has quit [Ping timeout: 240 seconds]
chrisdotcode has joined #ocaml
yminsky has joined #ocaml
yminsky has quit [Client Quit]
Drup has quit [Quit: Leaving.]
baz_ has joined #ocaml
Eyyub has joined #ocaml
nikki93 has quit [Remote host closed the connection]
baz_ has quit [Ping timeout: 248 seconds]
ollehar has quit [Ping timeout: 248 seconds]
yminsky has joined #ocaml
yminsky has quit [Quit: yminsky]
nikki93 has joined #ocaml
zxqdms has quit [Quit: leaving]
Eyyub has quit [Ping timeout: 241 seconds]
csakatok_ has joined #ocaml
csakatoku has quit [Ping timeout: 240 seconds]
csakatok_ has quit [Ping timeout: 246 seconds]
cesar_ has joined #ocaml
cesar_ is now known as Guest49147
csakatoku has joined #ocaml
yacks has quit [Quit: Leaving]
boogie has joined #ocaml
Eyyub has joined #ocaml
baz_ has joined #ocaml
baz_ has quit [Ping timeout: 264 seconds]
chrisdotcode has quit [Ping timeout: 272 seconds]
chrisdotcode has joined #ocaml
chrisdotcode has quit [Remote host closed the connection]
mcclurmc has quit [Remote host closed the connection]
mcclurmc has joined #ocaml
Eyyub has quit [Ping timeout: 264 seconds]
ygrek has quit [Ping timeout: 240 seconds]
boogie has quit [Remote host closed the connection]
boogie has joined #ocaml
talzeus_ has quit [Read error: Connection reset by peer]
talzeus has joined #ocaml
gour has joined #ocaml
Picolino has joined #ocaml
contempt has quit [*.net *.split]
Ptival has quit [*.net *.split]
ohama has quit [*.net *.split]
buddyholly has quit [*.net *.split]
n0v has quit [*.net *.split]
Armael has quit [*.net *.split]
mcclurmc has quit [Remote host closed the connection]
boogie has quit [Remote host closed the connection]
Guest49147 has quit [Remote host closed the connection]
ygrek has joined #ocaml
ulfdoz has joined #ocaml
csakatok_ has joined #ocaml
csakatoku has quit [Ping timeout: 244 seconds]
ulfdoz has quit [Ping timeout: 272 seconds]
ollehar has joined #ocaml
cesar_ has joined #ocaml
cesar_ is now known as Guest75787
baz_ has joined #ocaml
baz_ has quit [Ping timeout: 244 seconds]
Simn has joined #ocaml
yezariaely has joined #ocaml
<smiler> Nothing about m4 is self-explanatory :P
* smiler has bitter memories of struggling with sendmail m4 configuration
Guest75787 has quit [Remote host closed the connection]
zpe has joined #ocaml
Eyyub has joined #ocaml
mcclurmc has joined #ocaml
mcclurmc has quit [Ping timeout: 246 seconds]
Yoric has joined #ocaml
yezariaely has quit [Remote host closed the connection]
yezariaely has joined #ocaml
Kakadu has joined #ocaml
cago has joined #ocaml
ttamttam has joined #ocaml
nikki93 has quit [Remote host closed the connection]
justdit has joined #ocaml
ttamttam has quit [Client Quit]
rand000 has joined #ocaml
bentnib_ has joined #ocaml
mariusae_ has joined #ocaml
jlouis_ has joined #ocaml
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
ttamttam has joined #ocaml
20WAAKLGX has joined #ocaml
contempt has joined #ocaml
Ptival has joined #ocaml
ohama has joined #ocaml
buddyholly has joined #ocaml
n0v has joined #ocaml
Armael has joined #ocaml
othiym23` has joined #ocaml
contempt has quit [Max SendQ exceeded]
csakatok_ has quit [*.net *.split]
peterbb has quit [*.net *.split]
gasche has quit [*.net *.split]
saml has quit [*.net *.split]
mariusae has quit [*.net *.split]
egghead has quit [*.net *.split]
othiym23 has quit [*.net *.split]
IbnFirnas_ has quit [*.net *.split]
ousado has quit [*.net *.split]
bentnib has quit [*.net *.split]
jlouis has quit [*.net *.split]
xaimus has quit [*.net *.split]
csakatoku has joined #ocaml
peterbb has joined #ocaml
gasche has joined #ocaml
saml has joined #ocaml
egghead has joined #ocaml
IbnFirnas_ has joined #ocaml
ousado has joined #ocaml
contempt has joined #ocaml
zpe has quit [Ping timeout: 264 seconds]
xaimus has joined #ocaml
kyrylo has joined #ocaml
contempt has quit [Ping timeout: 248 seconds]
contempt has joined #ocaml
rand000 has quit [Ping timeout: 264 seconds]
platypine has joined #ocaml
contempt has quit [Ping timeout: 244 seconds]
platypine has quit [Ping timeout: 246 seconds]
contempt has joined #ocaml
eikke has joined #ocaml
cesar_ has joined #ocaml
cesar_ is now known as Guest51706
contempt has quit [Ping timeout: 240 seconds]
cago has quit [Quit: Leaving.]
cago1 has joined #ocaml
mcclurmc has joined #ocaml
contempt has joined #ocaml
Guest51706 has quit [Ping timeout: 240 seconds]
mcclurmc has quit [Ping timeout: 246 seconds]
<companion_cube> o/
<Kakadu> \o
baz_ has joined #ocaml
Yoric has quit [Ping timeout: 245 seconds]
baz_ has quit [Ping timeout: 246 seconds]
<adrien> o/
AltGr has joined #ocaml
justdit has quit [Quit: Lost terminal]
nikki93 has joined #ocaml
thomasga has joined #ocaml
zpe has joined #ocaml
nikki93 has quit [Ping timeout: 264 seconds]
mfp has joined #ocaml
kyrylo has quit [Ping timeout: 245 seconds]
Eyyub has quit [Ping timeout: 245 seconds]
Eyyub has joined #ocaml
ollehar has quit [Ping timeout: 248 seconds]
_andre has joined #ocaml
ollehar has joined #ocaml
csakatoku has quit [Remote host closed the connection]
csakatoku has joined #ocaml
mcclurmc has joined #ocaml
tulloch has joined #ocaml
csakatoku has quit [Ping timeout: 272 seconds]
mcclurmc has quit [Ping timeout: 246 seconds]
yacks has joined #ocaml
<adrien_oww> so, was reading http://caml.inria.fr/mantis/view.php?id=6139 and avsm says "With the splitting out otherlibs/ from the compiler distribution"
<adrien_oww> have I missed something else again?
csakatoku has joined #ocaml
sepp2k has joined #ocaml
Vinnipeg has joined #ocaml
Vinnipeg has quit [Client Quit]
Vinnipeg has joined #ocaml
csakatoku has quit [Remote host closed the connection]
csakatoku has joined #ocaml
Vinnipeg has quit [Client Quit]
<Kakadu> Rather interesting question from a man who wants to replace python by OCaml: http://stackoverflow.com/questions/19975140/how-to-stop-ocaml-garbage-collecting-my-reactive-event-handler
csakatoku has quit [Ping timeout: 248 seconds]
cdidd has quit [Ping timeout: 264 seconds]
rand000 has joined #ocaml
BitPuffin has joined #ocaml
tulloch has quit [Ping timeout: 272 seconds]
q66 has quit [Ping timeout: 260 seconds]
cesar_ has joined #ocaml
cesar_ is now known as Guest34208
Guest34208 has quit [Ping timeout: 272 seconds]
eikke has quit [Ping timeout: 248 seconds]
jonludlam has joined #ocaml
tulloch has joined #ocaml
yezariaely has quit [Ping timeout: 252 seconds]
ygrek has quit [Remote host closed the connection]
ygrek has joined #ocaml
mcclurmc has joined #ocaml
mcclurmc has quit [Ping timeout: 246 seconds]
q66 has joined #ocaml
yezariaely has joined #ocaml
yezariaely has quit [Client Quit]
Yoric has joined #ocaml
baz_ has joined #ocaml
baz_ has quit [Ping timeout: 248 seconds]
Kakadu has quit [Remote host closed the connection]
Kakadu has joined #ocaml
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
dsheets has joined #ocaml
ygrek has quit [Ping timeout: 246 seconds]
zpe has quit [Ping timeout: 252 seconds]
Eyyub has quit [Ping timeout: 248 seconds]
zpe has joined #ocaml
ggole has joined #ocaml
mchqwerty has joined #ocaml
skchrko has joined #ocaml
Kakadu has quit [Read error: Connection reset by peer]
rand000 has quit [Ping timeout: 246 seconds]
Eyyub has joined #ocaml
Kakadu has joined #ocaml
eikke has joined #ocaml
rand000 has joined #ocaml
mcclurmc has joined #ocaml
thomasga has quit [Quit: Leaving.]
darkf has quit [Quit: Leaving]
mcclurmc has quit [Ping timeout: 246 seconds]
Drup has joined #ocaml
breakds has joined #ocaml
Drup has quit [Remote host closed the connection]
Drup has joined #ocaml
_andre has quit [Read error: Connection reset by peer]
cesar_ has joined #ocaml
cesar_ is now known as Guest71377
rand000 has quit [Ping timeout: 244 seconds]
zpe has quit [Remote host closed the connection]
Guest71377 has quit [Ping timeout: 246 seconds]
zpe has joined #ocaml
zpe has quit [Ping timeout: 260 seconds]
thomasga has joined #ocaml
rand000 has joined #ocaml
zpe has joined #ocaml
tulloch has quit [Ping timeout: 240 seconds]
Eyyub has quit [Read error: Operation timed out]
BitPuffin has quit [Ping timeout: 252 seconds]
tulloch has joined #ocaml
Kakadu has quit [Read error: Operation timed out]
Kakadu has joined #ocaml
_andre has joined #ocaml
cdidd has joined #ocaml
mcclurmc has joined #ocaml
chambart has joined #ocaml
tulloch has quit [Ping timeout: 248 seconds]
tulloch has joined #ocaml
mcclurmc has quit [Ping timeout: 246 seconds]
BitPuffin has joined #ocaml
tulloch has quit [Ping timeout: 260 seconds]
rand000 has quit [Ping timeout: 248 seconds]
baz_ has joined #ocaml
ygrek has joined #ocaml
NoNNaN has joined #ocaml
baz_ has quit [Ping timeout: 265 seconds]
talzeus has quit [Remote host closed the connection]
bholst has quit [Quit: No Ping reply in 180 seconds.]
bholst has joined #ocaml
tulloch has joined #ocaml
<companion_cube> gasche: would it work to have a "private" annotation on mutable fields of a record, so that the field can be read only ?
ygrek has quit [Ping timeout: 252 seconds]
rand000 has joined #ocaml
tulloch has quit [Ping timeout: 265 seconds]
tulloch has joined #ocaml
jonludlam has quit [Remote host closed the connection]
<ggole> private types allow that (but only for every part of the record).
morolin_ has quit [Read error: Network is unreachable]
morolin_ has joined #ocaml
jonludlam has joined #ocaml
<Drup> does it ? how do you do it ?
<ggole> type foo = private { ... }, I think
<Drup> but does it allow to read the content then ?
<ggole> Yeah
<ggole> You can't create one though
<ggole> Need a constructor for that
<Drup> huuum
<Drup> ok, it seems to work, I will try that
<ggole> Something like module Test : sig type foo = private {mutable foo: int;} val create_foo: int -> foo end = struct type foo = {mutable foo: int;} let create_foo x = { foo = x } end
<ggole> You can match, get fields etc on a foo but can't mutate the field (except internally to Test).
<Drup> I think it suits my need, I will have to test a bit
jonludlam has quit [Ping timeout: 260 seconds]
<companion_cube> ggole: I think you need to have the same mutability annotations
<ggole> In that example I do?
thomasga has quit [Quit: Leaving.]
<companion_cube> ohhhhhhhhhh
<companion_cube> it's already the case ♥
<companion_cube> that is awesome
<ggole> You can't do it per field though
<ggole> But yeah, private types are nice
thomasga has joined #ocaml
<companion_cube> private types are just perfect for hashconsing
mcclurmc has joined #ocaml
mcclurmc has quit [Ping timeout: 246 seconds]
BitPuffin has quit [Quit: WeeChat 0.4.2]
mchqwerty has quit [Quit: Odcházím]
BitPuffin has joined #ocaml
mchqwerty has joined #ocaml
Drup has quit [Ping timeout: 260 seconds]
Neros has quit [Ping timeout: 244 seconds]
Drup has joined #ocaml
Drup1 has joined #ocaml
cesar_ has joined #ocaml
cesar_ is now known as Guest16707
Drup has quit [Ping timeout: 272 seconds]
Guest16707 has quit [Ping timeout: 244 seconds]
mcclurmc has joined #ocaml
Neros has joined #ocaml
CalimeroTeknik has quit [Ping timeout: 246 seconds]
shinnya has joined #ocaml
mch has joined #ocaml
jonludlam has joined #ocaml
CalimeroTeknik has joined #ocaml
mchqwerty has quit [Ping timeout: 244 seconds]
Neros has quit [Ping timeout: 245 seconds]
BitPuffin has quit [Quit: WeeChat 0.4.2]
BitPuffin has joined #ocaml
talzeus has joined #ocaml
tulloch has quit [Ping timeout: 272 seconds]
Neros has joined #ocaml
mch has quit [Ping timeout: 260 seconds]
chrisdotcode has joined #ocaml
rand000 has quit [Ping timeout: 265 seconds]
mch has joined #ocaml
baz_ has joined #ocaml
baz_ has quit [Ping timeout: 240 seconds]
gour_ has joined #ocaml
gour_ has quit [Changing host]
gour_ has joined #ocaml
gour has quit [Disconnected by services]
mch has quit [Quit: Odcházím]
mchqwerty has joined #ocaml
mort___ has joined #ocaml
Neros has quit [Ping timeout: 245 seconds]
Neros has joined #ocaml
contempt has quit [Ping timeout: 264 seconds]
tulloch has joined #ocaml
BitPuffin has quit [Ping timeout: 246 seconds]
Yoric has quit [Read error: Operation timed out]
contempt has joined #ocaml
gour_ is now known as gour
cesar_ has joined #ocaml
cesar_ is now known as Guest76759
q66_ has joined #ocaml
q66 has quit [Disconnected by services]
q66_ is now known as q66
Guest76759 has quit [Remote host closed the connection]
cago1 has left #ocaml []
contempt has quit [Ping timeout: 244 seconds]
avsm has joined #ocaml
contempt has joined #ocaml
Kakadu has quit [Ping timeout: 260 seconds]
20WAAKLGX has quit [Quit: Leaving.]
cesar_ has joined #ocaml
cesar_ is now known as Guest53220
Guest53220 has quit [Remote host closed the connection]
contempt has quit [Ping timeout: 272 seconds]
contempt has joined #ocaml
NoNNaN has quit [Remote host closed the connection]
ousado has quit [Ping timeout: 272 seconds]
contempt has quit [Ping timeout: 252 seconds]
ousado has joined #ocaml
avsm has quit [Ping timeout: 252 seconds]
contempt has joined #ocaml
skchrko has quit [Quit: Leaving]
avsm has joined #ocaml
Neros has quit [Ping timeout: 245 seconds]
contempt has quit [Ping timeout: 246 seconds]
contempt has joined #ocaml
contempt has quit [Ping timeout: 260 seconds]
contempt has joined #ocaml
avsm has quit [Quit: Leaving.]
w0rm_x has joined #ocaml
avsm has joined #ocaml
contempt has quit [Ping timeout: 246 seconds]
w0rm_x has quit [Client Quit]
contempt has joined #ocaml
dsheets has quit [Quit: Leaving]
avsm has quit [Ping timeout: 252 seconds]
dsheets_ has joined #ocaml
ttamttam has quit [Quit: ttamttam]
sepp2k has quit [Quit: Konversation terminated!]
mchqwerty has quit [Quit: Odcházím]
Neros has joined #ocaml
eikke has quit [Ping timeout: 272 seconds]
Drup1 is now known as Drup
nikki93 has joined #ocaml
contempt has quit [Ping timeout: 260 seconds]
contempt has joined #ocaml
nikki93 has quit [Ping timeout: 272 seconds]
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
contempt has quit [Ping timeout: 260 seconds]
Xenasis has joined #ocaml
contempt has joined #ocaml
zpe has quit [Ping timeout: 240 seconds]
othiym23` is now known as othiym23
contempt has quit [Remote host closed the connection]
ollehar has quit [Quit: ollehar]
baz_ has joined #ocaml
ollehar has joined #ocaml
baz_ has quit [Read error: Operation timed out]
tulloch has quit [Ping timeout: 260 seconds]
shinnya has quit [Ping timeout: 272 seconds]
jonludlam has quit [Remote host closed the connection]
zpe has joined #ocaml
dsheets_ has quit [Ping timeout: 244 seconds]
<maurer> Hey, I've got a stack trace that cosists of only
<maurer> Fatal error: exception Failure("hd")
<maurer> Raised at file "pervasives.ml", line 20, characters 22-33
<maurer> then a bunch of lines of Called from file "map.ml", line 175, characters 19-22
<maurer> any idea how to figure out where _I_ actually called this?
<companion_cube> if you want a stacktrace, run you code with OCAMLRUNPARAM=b
<maurer> companion_cube: that is how I got the stack trace
<maurer> companion_cube: problem is it's truncated
<companion_cube> (and compile in debug mode)
<companion_cube> you need everything to be compiled in debug mode
<companion_cube> also, List.hd is dangerous ;)
<maurer> companion_cube: I didn't call it
<maurer> It's inside map.ml somewhere
<companion_cube> you mean, in Core? there's no List.hd in the standard OCaml's map.ml
<maurer> Look, I dunno, the stack trace says map.ml called it
<mrvn> # List.hd;;
<mrvn> - : 'a list -> 'a = <fun>
<mrvn> sure there is
zpe has quit [Ping timeout: 246 seconds]
<mrvn> maurer: did you call it with a closure containing List.hd?
<maurer> mrvn: I mean, i assume I must have
<maurer> but I use Maps in a _lot_ of places
<companion_cube> mrvn: not in map.ml
anderse has joined #ocaml
AltGr has left #ocaml []
nikki93 has joined #ocaml
mcclurmc has quit [Remote host closed the connection]
<adrien> mrvn: companion_cube means that OCaml's Map doesn't call List.hd :)
<adrien> maurer: typically and because of higher-order functions, I just check every step given by the stacktrace but as companion_cube mentionned, you need your libs compiled with -g
<adrien> but first, you should have a file called "map.ml" and depending on the libraries you use, only you can know where it's from
<adrien> libraries and compiler version
nikki93 has quit [Remote host closed the connection]
<maurer> adrien: I figured out what's going on at this point. Evidently Marshal assumes _zero_ things change about the software, not just "the datatype doesn't change"
<Drup> oh, you can change your software as long as you don't change the datatype
<maurer> Drup: Hm. I explicitly did not change that datatype
boogie has joined #ocaml
peterbb has quit [Ping timeout: 272 seconds]
<maurer> Drup: but my old saved data won't load
<maurer> and my new stuff will
<maurer> Or specifically, _some_ of my old saved data won't load
<mrvn> should only care about the type
<Drup> by "the datatype" I mean the whole representation
thomasga has quit [Read error: Connection reset by peer]
thomasga has joined #ocaml
<Drup> so if a library which you are using the type in your marshalized stuff change it's internal representation, you are screwed indeed.
<maurer> Drup: If I added functions to modules which define the datatype, would that cause a problem?
osa1 has quit [Ping timeout: 245 seconds]
<Drup> no
<maurer> hm
<Drup> I'm not sure about compiler internals, it probably have an effect at some point, but the last version didn't change anything on this aspect
nikki93 has joined #ocaml
<mrvn> the memory representation of types hasn't changed in ages afaik.
<adrien> maurer: Marshal is indeed pretty much a dump of memory
<adrien> it's nice because it has 'a -> string
<adrien> and back but it's way too barebones and unsafe
<adrien> something like sexplib, protobuf, yojson, atd(gen)/biniou (and many others) are way better for production
<adrien> I guess the main reason for Marshal is that camlp4 uses it to "talk" to the compiler
<adrien> but in that context, it makes sense
Drup has quit [Ping timeout: 246 seconds]
mcclurmc has joined #ocaml
Yoric has joined #ocaml
Xenasis has quit [Read error: Connection reset by peer]
thomasga has quit [Ping timeout: 245 seconds]
Arsenik has joined #ocaml
avsm has joined #ocaml
<maurer> adrien: I mean, I wanted to do something similar to just dumb read/show serialization from haskell
<maurer> adrien: in that I have a pretty much done, but complicated process that takes a long time and generates a data structure
<maurer> and then some stuff I'm still figuring out to do after that
<maurer> so I wanted to checkpoint the big daylong analysis thing
<adrien> one of the binary protocols sounds better: atdgen/biniou or protobuf or ...
<adrien> Marshal is nice for experimentation but you need to remember to drop it (I've already done the mistake several times)
<maurer> the whole reason I was using marshal is that I don't have time to write a proper serialization protocol
<maurer> just like you use read/show when you don't have time, not as "good" solutions
<avsm> just add bin_io and you get serializers generated
Drup has joined #ocaml
_andre has quit [Quit: leaving]
mcclurmc has quit [Remote host closed the connection]
<adrien> maurer: atdgen relies on you writing a type definition which is straightforward; others use camlp4 to derive everything
<adrien> everything is automate
<adrien> d
<adrien> (that doesn't mean I'm not waitinf for the runtime types with ocaml-ty :) )
<companion_cube> ♥
nikki93 has quit [Remote host closed the connection]
ggole has quit []
anderse has quit [Quit: anderse]
baz_ has joined #ocaml
BitPuffin has joined #ocaml
w0rm_x has joined #ocaml
baz_ has quit [Ping timeout: 260 seconds]
nikki93 has joined #ocaml
mcclurmc has joined #ocaml
stevespiegel has joined #ocaml
stevespiegel has left #ocaml []
stevespiegel has joined #ocaml
<stevespiegel> anyone have idea idea where the global toploop is located? i'm getting undefined global Toploop when linking
<stevespiegel> i assume I need to link in a library but i dont know which one
chambart has quit [Ping timeout: 244 seconds]
anderse has joined #ocaml
nikki93 has quit [Remote host closed the connection]
anderse has quit [Quit: anderse]
<dramas> where can i use begin/end?
<dramas> im having trouble aligning my statements with their associated done's
<dramas> and my editor normally balances curly braces for me
<asmanur> begin/end is the same as (/)
<dramas> i guess i have become accustomed to using that as a crutch
nikki93 has joined #ocaml
<dramas> i have no idea what this means asmanur
<asmanur> (e) == begin e end
<dramas> oh
<dramas> so parens create scope?
<asmanur> no?
nikki93 has quit [Remote host closed the connection]
<dramas> well i am clearly not understanding
klltkr has joined #ocaml
<dramas> basically i am asking if i can use begin to expicilty state where for constructs begin and end
anderse has joined #ocaml
<dramas> whreas i am using whitespace at the moment and suffering for the lack of editor indicating my scopes
<asmanur> the scope of what ?
<bernardofpc> dramas: post code helps make your question clearer ;-)
<dramas> each block of code
<dramas> ok bernardofpc
<dramas> i thought the question was pretty simple
<dramas> hang on
<asmanur> i mean it's hardcoded in the parser : begin e end is the SAME as ( e )
<asmanur> so the begin / end is irrelevant here
<asmanur> you should have the same question with ()
<dramas> yes asmanur
<dramas> i think you overestimate my understanding of the use of () here
<dramas> this is um
<dramas> day 3 of ocaml hacking for me
<dramas> so i have while for for while
<dramas> and it i keep tracking the done's up in my editor to make sure i've got enough
<asmanur> so ? your code is indented so it's easy enough to delimit the loops
<dramas> whereas vim normally shows me where they are
<dramas> asmanur: pretend this is not so easy for me.
<dramas> asmanur: because i would not be asking if it were.
avsm has quit [Ping timeout: 244 seconds]
<bernardofpc> dramas: your problem is that the pair "for ... do ... done" is not editor-matche ?
<asmanur> would that be clearer if the syntax were while () { } and likewise for for
anderse has quit [Client Quit]
<dramas> bernardofpc: precisely
<dramas> asmanur: yes because vim creates little blocks of pipes for me so i can more easily see what's going on with specific characters for creating scope
<asmanur> well you can write while ... do ( ) if you want
<dramas> thank you.
<bernardofpc> maybe you can even put the condition between paren's
<asmanur> but otherwise I guess you need to hack your editor to have what you want
<bernardofpc> (but I guess this is not so needed, nor useful)
<asmanur> bernardofpc: that does not help match the end of the while
<Drup> dramas: can't you do that with the indentation ?
<Drup> isn't it visually enough ?
<bernardofpc> let primes = Hashtbl.create n + 1 in -> you need parens in there, I guess
<dramas> Drup: maybe i smoked too much grass as a kid and i'm getting senile, or maybe i havent had enough sleep, or maybe the font is too small, or something, but no, i'm having trouble tracking that in my own head today and i'd prefer vim did it for me.
<bernardofpc> you could change identation to 4 spaces, that may help
<dramas> yeah that is true
<dramas> i generally have lots of long statements because i prefer to do that in perl
<Drup> 4 spaces indentation is terrible, tbh
<dramas> but i have lots less horizontal stuff going on in ocaml and much more vertical
<bernardofpc> you see
<dramas> also, bernardofpc, i am surprised to see you not remark on the change of that algorithm
<bernardofpc> usually, ocaml code will have tons of functions so very rarely you will write such stuff as that many fors
w0rm_x has left #ocaml []
<bernardofpc> I'm stioll wondering at the use of a Hashtbl there, tbh
<bernardofpc> and your while is not math good
<bernardofpc> (while it_sqd * !multiple * iterator < uppper)
<dramas> so at present the code from yesterday's been running for 1600 minutes finding a solution to a problem
<dramas> and i suspect it it wrong if it will ever return
<bernardofpc> also, you should learn the "incr" operation, if you're using that much mutability
<dramas> unless hashes are extraordinarily expensive, it seemed better to count the primes on the way up, break when i find it, and just return the highest prime i'd found.
<bernardofpc> nah
<bernardofpc> well, why not
<dramas> but maybe i am forcing my perlishness on this problem and being stubborn
<Drup> dramas: you are probably
<dramas> it is a habit. :/
<bernardofpc> well, usually, you should try to write the math (independent of language) before the code
<dramas> heh
<bernardofpc> and prove all the stuff inside
<bernardofpc> (bounds, etc)
<dramas> i did. but i wrote it in perl.
<dramas> it proved to be useless for the ocaml
<bernardofpc> I see
<bernardofpc> yeah
<bernardofpc> extract the math
<bernardofpc> this will not change with your language :D
<dramas> sorry, i've been hacking perl for a living since like 1997. it just gets stuck in your brains.
<bernardofpc> I know that
<bernardofpc> (for C)
<dramas> yeah, i reckon
<bernardofpc> (but I learnt math before, and I do math for a living)
<dramas> ah
<dramas> so i failed out of geometry in high school. that's the highest math i ever took.
<dramas> the reason i am able to do what i do for a living is i can pull in code other people have written and use their api's
<Drup> bernardofpc: that's not exactly true
<Drup> bernardofpc: the idioms can make an algorithme looks quite different in a langage or another
<bernardofpc> well, look different does not mean that the same math is underlying
<bernardofpc> and of course you can have a terrible one in <lang_1> and a perfect in <lang_2> because you wrote the right thing in the secodn, but not on the first
<dramas> i need to run to the bank gentlemen. thanks. i'll be back soonish.
<Drup> bernardofpc: basic example, recursive factorial vs loop. It "looks" different, but it's really the same. You may argue this a bit superficial though (and you will be a bit right)
jonludlam has joined #ocaml
tulloch has joined #ocaml
Anarchos has joined #ocaml
tulloch has quit [Ping timeout: 272 seconds]
mcclurmc has quit [Remote host closed the connection]
jonludlam has quit [Ping timeout: 246 seconds]
mcclurmc has joined #ocaml
NoNNaN has joined #ocaml
Kakadu has joined #ocaml
jonludlam has joined #ocaml
Eyyub has joined #ocaml
baz_ has joined #ocaml
chambart has joined #ocaml
middayc has joined #ocaml
Kakadu has quit [Quit: Konversation terminated!]
NoNNaN has quit [Ping timeout: 240 seconds]
wolfnn has joined #ocaml
kyrylo has joined #ocaml
mcclurmc has quit [Remote host closed the connection]
NoNNaN has joined #ocaml
baz_ has quit [Remote host closed the connection]
mcclurmc has joined #ocaml
nikki93 has joined #ocaml
darkf has joined #ocaml
Yoric has quit [Ping timeout: 240 seconds]
<dramas> how do i pass an anonymous function
<Anarchos> dramas (fun x -> x)
<dramas> i'm using Hashtbl.iter fun (n:int) -> stuff hashname
<dramas> so put the function in parens?
<companion_cube> yes, and omit the argument type
NoNNaN has quit [Remote host closed the connection]
<dramas> ok
<companion_cube> Hashtbl.iter (fun key value -> ....) tbl
<Anarchos> companion_cube he can left the argument type
<dramas> Anarchos: "she"
<bernardofpc> well, she could
<bernardofpc> but then the type is not correct
<companion_cube> Anarchos: yes, but it's useless in most cases
<Anarchos> companion_cube sure :)
<bernardofpc> (first argument is the function, second the table)
<dramas> mk, i think i have syntax issues elsewhere.
<bernardofpc> explicitly annotated types are (mostly) not needed in OCaml, though
<dramas> this again. :/
<dramas> bernardofpc: i am doing better with seeing my scoping now that i have had coffee and eaten something
<bernardofpc> but if you're learning, this can help find mistakes earlier because the typechecker will complain sooner
<dramas> :)
<dramas> also that anonymous function thing feels very R-ish
<dramas> at least the notation does
<bernardofpc> R as in S ?
<dramas> yes
<dramas> well, as in R, the descendent of S
<bernardofpc> sure
<companion_cube> it's quite common for functional languages
<bernardofpc> my bet is that they stole it from lisp :D
<dramas> golly, it's been a couple years since i wrote R code
<dramas> no wonder i am so rusty on this
<bernardofpc> anyway
<bernardofpc> I tried to understand the purpose of your hashtable, and failed
<dramas> oh
<dramas> well, for one it only contains the primes
<dramas> rather than the primes and not-primes
<companion_cube> bernardofpc: yes, only the syntax is different
<dramas> and since i am just picking an arbitrarily numbered prime, i am just asking the hash table for that prime
<dramas> bernardofpc: the assignment being "find the 10001th prime."
<dramas> it's a project euler thing.
<bernardofpc> oh
<bernardofpc> another one using PE to learn OCaml
<dramas> so i don't need like, a big list of primes.
<dramas> bernardofpc: is there a lot of that?
* bernardofpc
<dramas> oh
<bernardofpc> and probably other people as well
<dramas> may i pm?
<bernardofpc> no, probably this chan is better
<dramas> ok
<bernardofpc> people here do know OCml
<dramas> this would not be about ocaml.
<bernardofpc> oh
jonludlam has quit [Ping timeout: 244 seconds]
yezariaely has joined #ocaml
Eyyub has quit [Ping timeout: 272 seconds]
dsheets_ has joined #ocaml
mcclurmc has quit [Ping timeout: 246 seconds]
jonludlam has joined #ocaml
<dramas> eek, this sounds dire: Stack overflow during evaluation (looping recursion?).
mcclurmc has joined #ocaml
<companion_cube> dramas: you forgot a terminal case in a recursion, most likely
platypine has joined #ocaml
<dramas> i do not know what a terminal case is, and I am not intentionally recursing :)
<companion_cube> did you write a recursive function?
<dramas> not that i am aware of
<companion_cube> did you get a proper stacktrace this time?
<companion_cube> if you did not write a recursion function, it must be one from the standard library
<dramas> how do i get such?
<dramas> that is all it gave me as an error
<companion_cube> OCAMLRUNPARAM=b ./my_program
<dramas> huh
<dramas> apparently it was just stuck in a loop and did that
<dramas> to my knowledge there was no recursion
<companion_cube> you mean, a while loop?
<dramas> yep
<companion_cube> this is weird, a loop shouldn't consume the stack
<dramas> is there a benchmark or something module so that i may profile this code?
<companion_cube> well first you have to make it work
<dramas> oh
<dramas> the reason i know it was that while loop is i had not incremented my counter
<companion_cube> there are benchmarking libraries on opam though
<dramas> and when i fixed that it no longer exploded
<companion_cube> dramas: if you have a counter, you might prefer a for loop
<dramas> oh, there is an opam. that is comforting.
<dramas> yeah i would prefer a for loop but it's not as flexible as other for's
<companion_cube> opam is a package manager for installing ocaml packages
<dramas> i don't have for assignment ; condition ; expression
<companion_cube> dramas: the most flexible in ocaml is a recursive function, though :)
<dramas> yeah i surmised
<dramas> i am a cpan author, it seemed it would be the same
Arsenik has quit [Remote host closed the connection]
<dramas> so my new function with a hash instead of an array is way, way faster
<dramas> but provides me with the wrong number. :)
<dramas> which is not even prime!
<dramas> how useful!
Yoric has joined #ocaml
<companion_cube> the joy of debugging.
* companion_cube uses a mix of printf and assert to debug, usually
rand000 has joined #ocaml
<dramas> yes this is what i am doing
<dramas> i have become much more comfortable with the syntax in the last couple days
<dramas> for the most part it nowmakes sense, it' sjust a matter of knowing which pieces and parts i need
<dramas> and getting my stinkin logic correct :)
Xenasis has joined #ocaml
gour has quit [Quit: WeeChat 0.4.2]
<companion_cube> of course, you need to practice!
<dramas> yep. :)
<companion_cube> project euler is quite nice for this purpose
<dramas> no, $self, 42 is not prime. it is otherwise an interesting number though.
<dramas> companion_cube: yes, agree. i was originally pretty frustrated with it.
strobegen has quit [Quit: Leaving.]
<dramas> time for tacos, back later
Drup has quit [Quit: Leaving.]
<companion_cube> see ya
Drup has joined #ocaml
w0rm_x has joined #ocaml
w0rm_x has left #ocaml []
osa1 has joined #ocaml
tulloch has joined #ocaml
mort___ has quit [Quit: Leaving.]
t0yv0 has quit [Quit: Page closed]
rand000 has quit [Quit: leaving]
tulloch has quit [Ping timeout: 260 seconds]
Drup has quit [Ping timeout: 272 seconds]
Anarchos has quit [Quit: Vision[0.9.7-H-280704]: i've been blurred!]
yezariaely has quit [Quit: Leaving.]
peterbb has joined #ocaml
jonludlam has quit [Remote host closed the connection]
tulloch has joined #ocaml
boogie has quit [Remote host closed the connection]
tulloch has quit [Ping timeout: 260 seconds]
Drup has joined #ocaml
q66_ has joined #ocaml
Yoric has quit [Ping timeout: 245 seconds]
q66 has quit [Ping timeout: 260 seconds]
<Drup> I disagree with the "project euler is nice to learn a language"
<jzelinskie> +1!
<Drup> because you will naturally tend to use the paradigms you already now instead of using correct ones
<Drup> and math stuff tend to put you on the imperative style anyway
<jzelinskie> also, i find lots of the problems to not be super practical
<Drup> dramas: btw, that's presicely what you are doing ;)
<jzelinskie> solving math problems won't let you learn about server design etc
<Drup> dramas: you are using the imperative features of ocaml, it's ok, but you are not actually learning functional paradigms that much.
wolfnn has quit [Ping timeout: 264 seconds]
<jzelinskie> i find reading the standard library of a language can often be useful for learning idioms, depending on how high-level the standard library is
<jzelinskie> I'm not quite sure how useful reading the C++ STL would be
<jzelinskie> unless you already knew C++ well
companion_cube has quit [Ping timeout: 240 seconds]
companion_cube has joined #ocaml
mcclurmc has quit [Remote host closed the connection]
mcclurmc has joined #ocaml
shinnya has joined #ocaml
mcclurmc has quit [Remote host closed the connection]
mcclurmc has joined #ocaml
BitPuffin has quit [Read error: Connection reset by peer]
<dramas> Drup: well, i am starting to take a liking to the language
<dramas> Drup: so likely i will get into the other parts
<dramas> but right now, i have an assignment to turn in
madroach has quit [Ping timeout: 264 seconds]
<dramas> need to be familiar with the syntax, and i will take that as progress before mastery or full fluency or whichever
<Drup> oh, if you have assignment and all that stuff, ok
<dramas> you gotta know how ot ask where the bathroom is before you can uh, i don't have anything to finish that metaphor with
madroach has joined #ocaml
<Drup> dramas: I still think you should follow a book/tutorial of some sort, lot's of them are avaible
<dramas> i will likely do that if i get past this phase of the work
<Drup> ok :)
<dramas> hm
<dramas> i have a value that is not being incremented in a for foo do loop
<Drup> more precisely ?
<dramas> let me just paste it. but i would like to know why this is.
<dramas> on line 17
<dramas> the while on the inner for loop
<dramas> iterator is staying 2 for every run through it
<dramas> for n of 20
<dramas> and it seems very much to be in a nested loop, so why would it not increment via the for on uh, line 7
Drup1 has joined #ocaml