<myki>
Hello! I'm struggling with modules a little. I have nested two simple modules and I have problem defining 'with type..' so that it works properly. The code is here: http://pastebin.com/m4e3393f8. When I put in VERTEX type label = string, it works properly, but I want to abstract the signature from actual code and put "label = string" near Graph definition.
<BlackHC|>
nn
BlackHC| has quit ["Quit"]
seafood has quit [Read error: 145 (Connection timed out)]
<Smerdyakov>
myki, I don't understand the question. Why do you expect that code to type-check?
<myki>
Smerdyakov: I don't because probably around (1) something is missing. I need to link types Graph.V.t and Vertex.t
<Smerdyakov>
myki, it looks like you already know the basic feature for doing that.
<Smerdyakov>
myki, and you have correctly identified the place to use it.
<myki>
Smerdyakov: Could you give me some hint, what to put there?
<Smerdyakov>
Do you understand what [with type] means?
<Smerdyakov>
And have you read the manual to see its syntax?
<myki>
Yes, when in sig some type is defined as abstract, it's used to specialize this type (in this case label = string)
<Smerdyakov>
I have a feeling that if you read the manual description, you'll know what to do.
<myki>
Ok
struktured has joined #ocaml
<myki>
Smerdyakov: It would be great if you could answer me one question. I've found a solution in order for that to work, but essentially I have to write the same thing twice: V.label = string in (1) and label = string in line 29 (module V : VERTEX with label = string = Vertex). Why can't the ocaml infer automatically just from (1) what is the type of V.label ?
<Smerdyakov>
myki, the whole point of explicit signature annotations is to hide information.
<Smerdyakov>
myki, you must state everything that you want to be known.
Mr_Awesome has quit [Read error: 110 (Connection timed out)]
Mr_Awesome has joined #ocaml
pumpkin_ has joined #ocaml
pumpkin has joined #ocaml
pumpkin_ has quit [Connection timed out]
pumpkin has left #ocaml []
snhmib has quit ["Good riddance!"]
snhmib has joined #ocaml
snhmib has quit [Remote closed the connection]
snhmib has joined #ocaml
struktured has quit [Read error: 110 (Connection timed out)]
jeddhaberstro has quit []
Mr_Awesome has quit [Read error: 110 (Connection timed out)]
alexyk has joined #ocaml
struktured has joined #ocaml
<alexyk>
hmm, make world.opt in ocaml 3.11 does not build ocamlbuild.cmxa
ikaros has joined #ocaml
<alexyk>
and going in ocamlbuild and saying make native gives an arror
Mr_Awesome has joined #ocaml
Amorphous has quit [Read error: 104 (Connection reset by peer)]
Amorphous has joined #ocaml
apples` has quit ["Leaving"]
Yoric[DT] has joined #ocaml
shortc|desk has quit [Read error: 110 (Connection timed out)]
CoryDambach has quit ["Leaving"]
sporkmonger has quit []
snhmib has quit ["Good riddance!"]
mishok13 has joined #ocaml
acatout has quit [Read error: 60 (Operation timed out)]
acatout has joined #ocaml
alexyk has quit []
seafood has joined #ocaml
seafood has quit [Client Quit]
seafood has joined #ocaml
mishok13 has quit [Remote closed the connection]
mishok13 has joined #ocaml
Yoric[DT] has quit ["Ex-Chat"]
alexyk has joined #ocaml
ikaros has quit [".quit"]
alexyk has quit []
seafood has quit [No route to host]
_zack has joined #ocaml
asabil has joined #ocaml
gaja has quit ["leaving"]
gaja has joined #ocaml
johnnowak has joined #ocaml
__me has joined #ocaml
pango_ has quit ["I shouldn't really be here - dircproxy 1.0.5"]
pierre_m has joined #ocaml
rwmjones has joined #ocaml
_zack has quit ["Leaving."]
Palace_Chan has quit [Client Quit]
_zack has joined #ocaml
asabil has quit [Read error: 110 (Connection timed out)]
asabil has joined #ocaml
marmotine has joined #ocaml
pierre_m has left #ocaml []
petchema_ has joined #ocaml
petchema has quit [Read error: 110 (Connection timed out)]
shortc|desk has joined #ocaml
Kerris7 has joined #ocaml
<Kerris7>
hmm I wonder what exactly did the latest ODT update changed
Kerris7 has quit []
Kerris7 has joined #ocaml
Kerris7 has quit [Client Quit]
vpalle has joined #ocaml
jeremiah has quit [Read error: 104 (Connection reset by peer)]
^authentic has joined #ocaml
jeremiah has joined #ocaml
johnnowak has quit []
authentic has quit [Read error: 110 (Connection timed out)]
^authentic is now known as authentic
myki_ has joined #ocaml
myki has quit [Read error: 104 (Connection reset by peer)]
marmotine has quit ["mv marmotine Laurie"]
meteoryte has joined #ocaml
<meteoryte>
I'm no language theorist, but I've been pondering this for a few minutes... is there actually a need to refer to the current object (as "self" or "this" etc) in a strongly typed static language? Would the correct definition of scoping remove their need?
johnnowak has joined #ocaml
appletizer has joined #ocaml
appletizer has left #ocaml []
johnnowak has quit [Client Quit]
TaXules has quit [Remote closed the connection]
<__me>
meteoryte: how do you return the object itself from a method?
<meteoryte>
__me you're right, I can't think of a way. But is there ever a real need to do this? in a well structured program?
<meteoryte>
the caller would already have a reference to the object surely...
<__me>
I think so if runtime polymorphism comes into play. I'm very new to O'Caml, and it's OO-part seems to be a little different from most mainstream languages, so I can't speak for it, yet. But one subtype might create a new object (e.g. a clone of itself) while another one might just return this/self.
TaXules has joined #ocaml
mjrosenb is now known as kool-aid_nazi
kool-aid_nazi is now known as mjrosenb
acatout has quit [Read error: 60 (Operation timed out)]
<meteoryte>
I'm not sure if you can ensure full static type-safety if you allow runtime polymorphism (as opposed to just parametric polymorphism).
Kerris7 has joined #ocaml
TaXules has quit [Remote closed the connection]
vixey has joined #ocaml
<meteoryte>
actually I am probably mistaken there; I need to do more reading about late binding and think about this more
^authentic has joined #ocaml
Kerris7 has quit []
acatout has joined #ocaml
^authentic has quit [Read error: 60 (Operation timed out)]
^authentic has joined #ocaml
authentic has quit [Read error: 110 (Connection timed out)]
^authentic is now known as authentic
petchema_ has quit [Read error: 113 (No route to host)]
petchema_ has joined #ocaml
<meteoryte>
__me, I finally worked out a concrete example of why a this/self reference is needed:
<meteoryte>
def bar(c: C) { }
<meteoryte>
class C {
<meteoryte>
def foo() {
<meteoryte>
bar(this);
<meteoryte>
}
<meteoryte>
}
<meteoryte>
(sorry not in OCaml notation!)
vpalle has quit [Read error: 110 (Connection timed out)]
filp has joined #ocaml
authentic has quit [Read error: 104 (Connection reset by peer)]
authentic has joined #ocaml
^authentic has joined #ocaml
authentic has quit [Read error: 60 (Operation timed out)]
^authentic is now known as authentic
vpalle has joined #ocaml
<__me>
I can read it anyway. So yes that's another example.
<flux>
meteoryte, btw, ocaml doesn't need 'this' or 'self', but you can declare it if you need it
<flux>
and if you have define an object inside an object you might want to choose different names for 'this'
<meteoryte>
thanks flux; yes I noticed Ocaml is quite nice in this regard
__me has left #ocaml []
__me has joined #ocaml
__me has left #ocaml []
authentic has quit [Read error: 110 (Connection timed out)]
Kerris7 has joined #ocaml
rwmjones is now known as rwmjones_afk
ikaros has joined #ocaml
<munga>
can I write a camlp4 entry that looks like [[ l = LIST1 var ; EOL - > l ]] where EOL is the end of line ?
<munga>
alternatively, is there a way to look-ahead one character ? I remember this was possible with a hack in camlp5 ... some hack in camlp4 ?
rwmjones_afk is now known as rwmjones
vpalle has quit [Read error: 110 (Connection timed out)]
ikaros has quit [Read error: 110 (Connection timed out)]
ikaros has joined #ocaml
willb has quit [Read error: 110 (Connection timed out)]
alexyk has joined #ocaml
sporkmonger has joined #ocaml
authentic has joined #ocaml
filp has quit ["Bye"]
vpalle has joined #ocaml
vpalle has quit [Client Quit]
<alexyk>
anyone built ocamlbuild native with 3.11?
<alexyk>
I don't see ocamlbuild.opt nor ocamlbuildlib.cmxa needed by stuff which worked under 3.10.2
<alexyk>
make world.opt or opt.opt from top dir of 3.11 doesn't do it in ocamlbuild/
_zack has quit ["Leaving."]
<mfp>
I find it somewhat irritating when something is released and you get on reddit: (1) the project upload page (2) the home page (3) the ML announcement (4) the blog announcement (identical to 3)
<Smerdyakov>
I find it annoying to have anything to do with Reddit.
<mfp>
the message is clearly "you're going to read it whether you like it or not"
<purple__>
In the lwt source in lwt_unix.ml there is a note that "Non-blocking I/O and select does not (fully) work under Windows." with a list of possible issues. Is this due to the posix emulation of select() that i think occurs in cygwin dll (i have not used ocaml in anything other than linux). Does anyone know if there are plans to write native bindings to winsock ?
apples` has joined #ocaml
alexyk has joined #ocaml
willb has quit [Read error: 110 (Connection timed out)]
ofaurax has joined #ocaml
<olegfink>
alexyk: I always wanted to, but what has APL to do with ocaml?
marmotine has quit ["mv marmotine Laurie"]
<alexyk>
olegfink: well it's a functional language and looks compact :)
<alexyk>
also ocaml has advantages in finance, and kx/Q also shines there
<alexyk>
C_Tux: APL is the APL by Ken Iverson, J is his reincarnation of it, kx.com is a superfast database for finance with Q which is a gibberish-looking APL-like language
vpalle__ has quit [Connection timed out]
<psnively>
Yeah, we might want to generalize the question to "Has anyone done vector operations as a concise library in Ocaml?"
<alexyk>
there's also A+ used in Morgan Stanlet, aplusdev.org
<alexyk>
...Stanley
<alexyk>
psnively: exactly
<alexyk>
and all kinds of compressed-looking functions
<olegfink>
...and unicode alphabet :-)
Kerris7 has joined #ocaml
<C_Tux|Busy>
alexyk, it looked unreadable to me but I'll give it another try ;)
<alexyk>
olegfink: need labels for keyboard
anders__ has quit [Read error: 110 (Connection timed out)]