dark_light changed the topic of #ocaml to: OCaml 3.09.2 available! Archive of Caml Weekly News: http://sardes.inrialpes.fr/~aschmitt/cwn/ | A free book: http://cristal.inria.fr/~remy/cours/appsem/ | Mailing List: http://caml.inria.fr/bin/wilma/caml-list/ | Cookbook: http://pleac.sourceforge.net/
shans_home has joined #ocaml
Skal has quit [Remote closed the connection]
danly has quit [Read error: 54 (Connection reset by peer)]
smimou has quit ["bli"]
postalchris has quit [Read error: 113 (No route to host)]
chessguy has joined #ocaml
falconair has quit []
mw_ has joined #ocaml
mw has quit [Read error: 54 (Connection reset by peer)]
mikeX has quit ["zzz"]
chessguy has quit [" HydraIRC -> http://www.hydrairc.com <- IRC with a difference"]
romildo has joined #ocaml
<romildo> Hi.
<romildo> About mutability of record fields: does int has any impact on field access performance?
<romildo> s/int/it/
<romildo> That is, the expression p.x has different performance for the types { x:int } and { mutable x:int } ?
<levi_home> I'm not positive, but I think mutable makes it a ref type.
falconair has joined #ocaml
<Smerdyakov> No, 'ref' is a record type with one mutable field. :)
<numist> ozzloy: stop following me!!
<Smerdyakov> numist, are you the guy with the Visual Studio plugin?
<Smerdyakov> For Coq
<numist> uh, no?
<numist> I dont think I'm that person
<Smerdyakov> OK. His domain is nummist.com. :)
<numist> I'll bet he misspelled it.
<numist> thats rather odd... thought I was the only one of me out there..
<Smerdyakov> Your domain is slow!
<Smerdyakov> Yeah, so if you want to see some far-off stuff, look no further than nummist.com. :)
<Smerdyakov> s/far-off/far-out
<numist> alrighty then
<Smerdyakov> Where is numist.net hosted?
<numist> simpli.biz
<numist> right next to a kernel mirror.. its pretty slick
<Smerdyakov> Hm... it was pretty slow for me.
llama32 has joined #ocaml
duncanm has quit [Read error: 104 (Connection reset by peer)]
duncanm has joined #ocaml
<numist> its currently working for its money
<numist> more of a dev server than a production server
Smerdyakov has quit ["Leaving"]
<dark_light> is there any way an ocaml program finds the network interfaces and grab the inet/inet6 addresses of it? i have an ppp0 interface that the ifconfig command can find the inet address but i don't find any function in Unix module to find it
<romildo> What are the rules for field names in record types? I have written the types
<romildo> type t1 = { x:int; y:int } type t2 = { x:int; msg:string }
<romildo> which the compiler accepted.
<romildo> But when declaring a value
<romildo> let a:t1 = { x=1; y=2 }
<romildo> the compiler emits the error message
<romildo> The record field label y belongs to the type t1
<romildo> but is here mixed with labels of type t2
<dark_light> romildo, i think you can't have the same field for two types
<romildo> That is my conclusion too. But searching the reference manual, I could not find such a rule.
<romildo> And it looks like a too rigid restriction.
<dark_light> i don't use so much records because of the oddities (like Module.name.Module.field)
<dark_light> romildo, in Unix module there are type host_entry = { h_name : string; h_aliases : string array ... } and a type protocol_entry { p_name : string; p_aliases : string array ... } so i think the same field really can't be in various types
<dark_light> and it indeed seems to be too rigid.. ocaml permits polymorphism based on method names for objects but not field names for records
<romildo> right.
dark_light has quit [orwell.freenode.net irc.freenode.net]
knobo has quit [orwell.freenode.net irc.freenode.net]
eradman has quit [orwell.freenode.net irc.freenode.net]
pingu has quit [orwell.freenode.net irc.freenode.net]
batdog has quit [orwell.freenode.net irc.freenode.net]
Ugarte has quit [orwell.freenode.net irc.freenode.net]
numist has quit [orwell.freenode.net irc.freenode.net]
mattam has quit [orwell.freenode.net irc.freenode.net]
dark_light has joined #ocaml
numist has joined #ocaml
knobo has joined #ocaml
pingu has joined #ocaml
eradman has joined #ocaml
mattam has joined #ocaml
Ugarte has joined #ocaml
batdog has joined #ocaml
eradman has quit [Remote closed the connection]
eradman has joined #ocaml
pango_ has joined #ocaml
_velco has joined #ocaml
pango has quit [Remote closed the connection]
llama32 has quit [Remote closed the connection]
romildo has quit ["Leaving"]
<flux__> pango_, nice piece of code, I had been thinking of doing something similar so I would be able to grep for types
<flux__> but it would@ve done the grepping directly with emacs & the .annot-file. thay suits just as well..
<flux__> pango_, btw, there is some kind of bug handling the end of the file.. of t
<flux__> uh. on your source I got a sequence of :unit):unit):unit) at the end..
sponge45 has joined #ocaml
<pango_> I don't think it's a bug... just several "regions" ending at the same place (they can overlap)
Snark_ has joined #ocaml
<pango_> flux__: somehow lots of sequences and let bindings end at the EOF ;)
eradman has quit [orwell.freenode.net irc.freenode.net]
Ugarte has quit [orwell.freenode.net irc.freenode.net]
pingu has quit [orwell.freenode.net irc.freenode.net]
numist has quit [orwell.freenode.net irc.freenode.net]
mattam has quit [orwell.freenode.net irc.freenode.net]
dark_light has quit [orwell.freenode.net irc.freenode.net]
knobo has quit [orwell.freenode.net irc.freenode.net]
batdog has quit [orwell.freenode.net irc.freenode.net]
eradman has joined #ocaml
dark_light has joined #ocaml
numist has joined #ocaml
knobo has joined #ocaml
pingu has joined #ocaml
mattam has joined #ocaml
Ugarte has joined #ocaml
batdog has joined #ocaml
slipstream-- has quit [Read error: 54 (Connection reset by peer)]
<pango_> dark_light: everything's rather logical, once accepted that modules are the unit of namespace, _including_ for records field names
<flux__> maybe logical, but inconvenient :)
<flux__> I sometimes do for example let module D = Database in .. when I need to deal a lot with rcords
<dark_light> pango_, well this piece of code: a.b + 1 works only when i have an existing record with the field b of type int
<dark_light> pango_, if it worked even if i have no type, it would be great :) (because i could have types that depends only on some fields)
<dark_light> like objects in ocaml
<pango_> yes... But I suspect you'd lose pure O(1) access to fields
<flux__> how does sml do it?
slipstream has joined #ocaml
<pango_> or rather, 2 indirections instead of 1, so it would still be O(1)
<dark_light> i would like to have an.. well "namespace" directive to perform open only in certain ugly parts of code
<pango_> (I suppose the same trick used for method lookups could be used ?=
<pango_> )
<flux__> dark_light, there is an "open in" language extension at caml hump
<dark_light> nice
llama32 has joined #ocaml
<dark_light> i will try to install it here, that extensions are cool :)
<dark_light> pango_, i have no idea how ocaml treat such things and i better avoid it for a while =)
<dark_light> by the way, there are some modules like Obj and CamlInternalMod that seems like dark magic :o Obj.magic for example :)
<dark_light> if Obj.magic 1 then 'a' else 'b' returns 'a'.. but if Obj.magic 0 then 'a' else 'b' returns 'b'.. :o :o :o
<pango_> yes... lots of fun things, including segmentation faults ;)
<pango_> for some reason, bug reports won't be accepted if Obj module is being used in source example ;)
<flux__> dark_light, why is that surprising?-o
<dark_light> ahahahahhaha.. segmentation faults, seems a huge add for the language..
<dark_light> flux__, i have no clue how this could be implemented in ocaml itself
<pango_> well, Marshall is unsafe too, and it's not supposed to be as dark magic as Obj
<dark_light> Marshall is unsafe?
<pango_> yes :/
<dark_light> why? if i am reading, i should be sure that what i read is really a valid data..
<dark_light> it is supposed to check the data too?
<pango_> not always... They're works like HashCaml (GCaml too) that make marshalling safer
<dark_light> actually i consider them dark magic because the library reference has no documentation on them
<dark_light> well only the function signatures :)
<pango_> it's Marshal, with a single 'l' (?) http://caml.inria.fr/pub/docs/manual-ocaml/libref/Marshal.html
<pango_> mmh it seems both are allowed
<pango_> marshaling/marshalling, etc.
<dark_light> hmm yes, i have ocaml-doc here. and, hmm ocaml-doc has other docs too, nice.. there are an camlp4 tutorial here, hm
<pango_> # if (Marshal.from_string (Marshal.to_string 0 []) 0) then "a" else "b" ;;
<pango_> - : string = "b"
<pango_> # if (Marshal.from_string (Marshal.to_string 1 []) 0) then "a" else "b" ;;
<pango_> - : string = "a"
Kzzch has quit ["Snak 5.1.5 IRC For Macintosh - http://www.snak.com"]
<dark_light> :o
<pango_> # if (Marshal.from_string (Marshal.to_string 0 []) 0) = "hello" then "a" else "b" ;;
<pango_> Segmentation fault
<dark_light> it should have launched exceptions. that's why you say marshal is unsafe?
<pango_> yes
_fab has joined #ocaml
<dark_light> Hmmm.. well.. in such cases why ocaml doesn't resolved the functions at compile time? (Marshal.from_string (Marshal.to_string 0 []) 0) is a constant and has type int
<pango_> won't fix the problem when marshalling and unmarshalling happen in different programs, or even over a network
<dark_light> well it has type 'a but should have type int, because the compiler may resolve this function for the programmer at compile time..
<dark_light> well, sure, but it's a desirable optimization (at least for me)
<pango_> or in the same program, but in different runs
mattam has quit [Remote closed the connection]
mattam has joined #ocaml
<pango_> and that's the bread and butter of Marshal module
<pango_> the "real" fix is to embed enough informations about types in the streamed representation, so that unmarshalling can be safely accomplished
<pango_> and it's not that trivial
<dark_light> yes.. never needed to use marshal anyway
<pango_> some do ;)
<pango_> actually there's libraries that provide safe marshalling, ioxml, sexplib,...
<pango_> btw, the definition of "language safety" that I've read is that it "protects its own abstractions"
dark_light is now known as EliasAmaral
falconair has quit []
<pango_> by this definition calling C code is not safe... Not only because of the possibility of segfaults if they're bugs, but also because you could use it to modify immutable values, etc., breaking language's abstractions
clog has joined #ocaml
Wazm_ has joined #ocaml
jajs has joined #ocaml
mattam has quit [Remote closed the connection]
mattam has joined #ocaml
jca has joined #ocaml
llama32 has quit [Read error: 110 (Connection timed out)]
romildo has joined #ocaml
<romildo> Hi.
<romildo> I am writing my first ocamlyacc grammar, and I want to know how to write an empty production rule, like X ->
<romildo> Any clue?
rillig has joined #ocaml
jca_ has quit [Read error: 110 (Connection timed out)]
smimou has joined #ocaml
lde has joined #ocaml
jca_ has joined #ocaml
jca has quit [Read error: 110 (Connection timed out)]
yondalf has joined #ocaml
<romildo> Can ocamldep deal with ocamllex and ocamlyacc input files?
yondalf has quit [Read error: 60 (Operation timed out)]
_fab has joined #ocaml
shans_home_ has joined #ocaml
shans_home has quit [Read error: 110 (Connection timed out)]
romildo has quit ["Leaving"]
sponge45 has left #ocaml []
llama32 has joined #ocaml
<fremo> rillig: "x: " or "x: {}" doesnt work ?
<fremo> oups
<fremo> it was for romildo
<fremo> but he left...
bluestorm has quit ["Konversation terminated!"]
ebel has joined #ocaml
beschmi has joined #ocaml
Smerdyakov has joined #ocaml
chessguy has joined #ocaml
beschmi has quit [Read error: 60 (Operation timed out)]
beschmi has joined #ocaml
llama32 has quit [Read error: 110 (Connection timed out)]
ebel_ has joined #ocaml
ebel has quit [Read error: 60 (Operation timed out)]
ebel_ has quit ["Leaving"]
postalchris has joined #ocaml
duncanm_ has joined #ocaml
duncanm has quit [Read error: 104 (Connection reset by peer)]
ikaros has quit [Read error: 60 (Operation timed out)]
ikaros has joined #ocaml
duncanm_ has quit [Read error: 110 (Connection timed out)]
ayrnieu has joined #ocaml
jajs has quit [Remote closed the connection]
katatsumuri has joined #ocaml
katatsumuri has quit [Client Quit]
katatsumuri has joined #ocaml
love-pingoo has quit ["Connection reset by pear"]
kisu has joined #ocaml
postalchris has quit [Read error: 110 (Connection timed out)]
<stesch> Is there a Planet OCaml?
<stesch> (A central point to subscribe to a RSS feed, not something NASA would report.)
chessguy2 has joined #ocaml
chessguy has quit [Nick collision from services.]
chessguy2 is now known as chessguy
<Smerdyakov> stesch, there is an RSS feed for the official OCaml releases. I know of nothing else.
pango has quit ["Leaving"]
pango has joined #ocaml
postalchris has joined #ocaml
falconair has joined #ocaml
Skal has quit [Remote closed the connection]
jajs has joined #ocaml
giftcard has joined #ocaml
<giftcard> hello
<giftcard> I am getting this error and it doesn't make sense to me: This expression has type env * binding list but is here used with type
<giftcard> env * binding list
<giftcard> error is: This expression has type env * binding list but is here used with type env * binding list
<giftcard> i can resolve this error by restarting ocaml
<Smerdyakov> You've probably defined multiple types with the name env, binding, or list.
<Smerdyakov> For instance, reloading your source code interactively creates new types with the same names as the old ones.
<giftcard> shouldn't ocaml take the newest type that I loaded in and use that?
<Smerdyakov> Sure, for subsequent interactions, but old values in the environment won't be updated magically.
<giftcard> ok. thank you
giftcard has left #ocaml []
jajs has left #ocaml []
pango has quit [Remote closed the connection]
pango has joined #ocaml
Kzzch has joined #ocaml
duncanm has joined #ocaml
malc_ has joined #ocaml
postalchris has quit ["Leaving."]
ozzloy has quit [Read error: 104 (Connection reset by peer)]
numist has quit [Read error: 104 (Connection reset by peer)]
beschmi has quit ["Leaving"]
Snark_ has quit ["Leaving"]
velco has quit ["I'm outta here ..."]
duncanm has quit [Read error: 104 (Connection reset by peer)]
duncanm has joined #ocaml
<Smerdyakov> Hooray. I have changed my closure converter to omit unused variables from closures.
duncanm has quit [Read error: 104 (Connection reset by peer)]
duncanm has joined #ocaml
Smerdyakov has quit ["Leaving"]
Smerdyakov has joined #ocaml
dylan has joined #ocaml
dylan has left #ocaml []
bluestorm has joined #ocaml
bluestorm has quit ["Konversation terminated!"]