<sproctor>
is it possible to have mutually recursive type and object definitions?
<sproctor>
I've been using parameterized types... but it gets really cumbersome.
<whee>
it should be
<whee>
but now I can't remember anything about the object system, so I don't know how that works. heh
<whee>
recursive objects should be much like recursive variants
<sproctor>
yeah, you can have mutually recursive objects.
<sproctor>
but you can't mix types and object.
<sproctor>
or at least AFAIK
<sproctor>
and the parameterized types solution is getting very cumbersome.
<whee>
I think I just have no idea what you're talking about, since I haven't done much with objects
<sproctor>
I want to say something like: type a = Foo | Bar b and class b = object...
<sproctor>
where a and b depend on each other.
<whee>
oh
<whee>
I'd be tempted to use polymorphic variants and heh
<Smerdyakov>
sproctor, I think you can do that.
<Smerdyakov>
sproctor, hm... or maybe I am thinking of class _types_.
<Smerdyakov>
sproctor, if you declare class types with "type name = < ... >" instead of "class type", you can get some recursive definitions.
<sproctor>
well, you can't do what I said.
<Smerdyakov>
sproctor, not sure about classes themselevs.
<Smerdyakov>
However, you can always define the type of the class like I said and use that, then define the class later.
<karryall>
sproctor: you can't
<karryall>
you have to parametrize your types
<sproctor>
yeah, this is just for the interfaces anyway.
<sproctor>
yuck
mattam has quit [Read error: 60 (Operation timed out)]
<sproctor>
Smerdyakov, you can define the type of a class mutually recursive with a normal type?
<Smerdyakov>
sproctor, I think so.
<Smerdyakov>
type a = whatever and type b = < f : b >
<Smerdyakov>
er
<Smerdyakov>
type a = whatever and type b = < f : a >
mattam has joined #ocaml
<karryall>
sproctor: you can define thee type of an *object*, mutually with other types
<sproctor>
can you coerce an object to an object type?
<karryall>
sure
<karryall>
that's always what's happening
<sproctor>
oh, alright.
<sproctor>
is there a way to require a class to implement at least all the methods in the object type?
<karryall>
hum
<karryall>
I don't think so
<karryall>
anyway I think using object types will prove much more cumbersome than doing parametrization thing
<karryall>
you cannot express inheritance relations with object types
<sproctor>
oh yeah...
<sproctor>
maybe if I parameterize the classes instead.
<karryall>
yeah, should work
<Smerdyakov>
OMG. Omega is the best part of Coq.
Nutssh has joined #ocaml
housetier has joined #ocaml
Axioplase has quit ["Error ZzzZ (connection reset by bed)"]
d2004xx has joined #ocaml
Nutssh has quit ["Client exiting"]
drWorm is now known as drworm
blueshoe has quit [Read error: 104 (Connection reset by peer)]
steele has left #ocaml []
taw has joined #ocaml
<taw>
hello
<taw>
what's the difference between (x : type) and (x :> type) ?
<Riastradh>
The latter is for types that involve sets of methods.
<Riastradh>
The former says 'x has type.' The latter says 'x is an object that supports _at_least_ these methods.'
<taw>
thanks^^
* taw
is reading about labelled types etc.
<taw>
weird stuff
Nutssh has joined #ocaml
TheDracle has quit [Read error: 60 (Operation timed out)]
buggs^z has joined #ocaml
buggs has quit [Read error: 110 (Connection timed out)]
blueshoe has joined #ocaml
blueshoe has quit [Read error: 54 (Connection reset by peer)]
housetier has quit ["#breaks @ irc.highteq.de"]
ChoJin has joined #ocaml
Riastrad1 has joined #ocaml
Riastradh has quit [Nick collision from services.]
Riastrad1 is now known as Riastradh
Nutssh has quit ["Client exiting"]
The-Fixer has joined #ocaml
The-Fixer has quit [Client Quit]
The-Fixer has joined #ocaml
Iorek has quit ["F(YF) = YF"]
Swynndla has joined #ocaml
blueshoe has joined #ocaml
The-Fixer has quit ["Goodbye"]
Smerdyakov has quit [Read error: 60 (Operation timed out)]
Smerdyakov has joined #ocaml
sproctor has quit [Read error: 110 (Connection timed out)]
wazze has quit ["Ein Dieb ist jemand, der die Angewohnheit hat, Dinge zu finden, bevor andere Leute sie verlieren"]
sproctor has joined #ocaml
blueshoe has quit [Read error: 104 (Connection reset by peer)]
blueshoe has joined #ocaml
blueshoe has quit [Read error: 54 (Connection reset by peer)]
whee has quit ["Leaving"]
Swynndla has quit ["Leaving"]
blueshoe has joined #ocaml
blueshoe has quit [Read error: 104 (Connection reset by peer)]
mimosa has joined #ocaml
mimosa has quit ["J'ai fini !"]
ChoJin has quit ["Client exiting"]
systems has joined #ocaml
<systems>
hi
systems has left #ocaml []
phubuh has quit [Remote closed the connection]
maihem_ has joined #ocaml
maihem has quit [Read error: 60 (Operation timed out)]
blueshoe has joined #ocaml
housetier has joined #ocaml
steele has joined #ocaml
housetier has quit ["#breaks @ irc.highteq.de"]
whiskas has joined #ocaml
housetier has joined #ocaml
whiskas has quit [Client Quit]
blueshoe has quit [Read error: 54 (Connection reset by peer)]
_JusSx_ has joined #ocaml
_JusSx_ has quit [Read error: 60 (Operation timed out)]
_JusSx_ has joined #ocaml
Demitar has quit [kornbluth.freenode.net irc.freenode.net]
Demitar has joined #ocaml
blueshoe has joined #ocaml
yangsx has joined #ocaml
maihem_ is now known as maihem
yangsx has quit [Read error: 104 (Connection reset by peer)]
housetier has quit [Read error: 54 (Connection reset by peer)]
Defcon7 has quit ["changing servers"]
Defcon7 has joined #ocaml
shawn has quit [Read error: 54 (Connection reset by peer)]
Nutssh has joined #ocaml
phubuh has joined #ocaml
_JusSx_ has quit ["My damn controlling terminal disappeared!"]
housetier has joined #ocaml
fjb has joined #ocaml
The-Fixer has joined #ocaml
owll has joined #ocaml
owll has left #ocaml []
whee has joined #ocaml
blueshoe has quit [Read error: 54 (Connection reset by peer)]
ejt_ has joined #ocaml
ejt has quit [Read error: 101 (Network is unreachable)]
Nutssh has quit ["Client exiting"]
malte has joined #ocaml
<malte>
greetings
<karryall>
hi malte
blueshoe has joined #ocaml
housetier has quit [Read error: 104 (Connection reset by peer)]
malte has quit ["Lämnar"]
blueshoe has quit [Read error: 104 (Connection reset by peer)]
fiopa has joined #ocaml
fiopa is now known as _JusSx_
Iorek has joined #ocaml
_JusSx__ has joined #ocaml
sproctor has quit [Read error: 54 (Connection reset by peer)]
wazze has joined #ocaml
Iorek has quit [Read error: 113 (No route to host)]
_JusSx_ has quit [Read error: 110 (Connection timed out)]
blueshoe has joined #ocaml
shawn has joined #ocaml
Etaoin has quit ["Client exiting"]
blueshoe has quit [Read error: 104 (Connection reset by peer)]
fjb has quit ["ChatZilla 0.9.52B [Mozilla rv:1.6/20040215]"]
Nutssh has joined #ocaml
phubuh has quit [Remote closed the connection]
blueshoe has joined #ocaml
_JusSx__ has quit ["My damn controlling terminal disappeared!"]
noss has joined #ocaml
<noss>
how exactly do i get caml4p to expand code with <:expr: ... >> in it?
<karryall>
hum, nothing: camlp4 need just have loaded the q_MLast extension
<noss>
?
<karryall>
??
<karryall>
what do you want to do exactly ?
<noss>
learn how you do quasiquotations by having the preprocessor expand them to ASTs
<noss>
now quasiquoting ocaml, but later other languages.
<karryall>
quasiquotations ? that's a scheme thing ?
<noss>
let my_fn = <:expr< List.iter (fun x -> x+1) [1; 2; 3] >>
<noss>
[cos@noss ocaml]$ camlp4o quasi.ml
<noss>
File "quasi.ml", line 1, characters 12-19:
<noss>
Unbound quotation: "expr"
<noss>
Im obviously missing something on how you do this expansion.
<karryall>
camlp4o q_MLast.cmo quasi.ml
<noss>
Hmm. Can I get that in a readable output?
<karryall>
with the toplevel
<noss>
the toplevel?
<karryall>
ocaml camlp4o.cma q_MLast.cmo
<karryall>
the interpreter if you prefer
<karryall>
or you can use camlp4 printer
<karryall>
camlp4o q_MLast.cmo pr_o.cmo quasi.ml
<noss>
yah, that works. when i try do that in the interpeter it complains about loc being undefined. for some reason it is trying to execute the expansion.
<noss>
unbound value loc is what it says, even.
<karryall>
ah yes, the quotation need a value named loc
<karryall>
it represents a position in source files
<karryall>
juste define it: let loc = (0, 0) ;;
<noss>
What other syntaxes are there, im reading a tutorial on c code generation and they use <:cstmt< ..
tantris has joined #ocaml
<karryall>
there's just q_MLast with camlp4
<karryall>
it has other quotations for other kinds of elements in the AST
<tantris>
Hi ocaml_beginners doesn't approve my subscription so I would like to ask here, there is the function create_process to run an external program and get its output and there is system with which I can gate the exit status of an external program but not its output, so how would I get both?
<karryall>
you mean you want to get the exit status of smthg created with create_process ?
<tantris>
yes
<tantris>
or it doesn't need to be created with create_process. I just want to run a program on a shell, get its exit status and output on stderr and stdout
<steele>
create_process returns a pid you can use with waitpid