<gobbledigook>
can anyone here answer my quick question?
rgrinberg has quit [Ping timeout: 244 seconds]
<Enjolras>
gobbledigook: what's the question ? It's tye with two constructors N and T which store value of type 'nonterminal and 'terminal
<Enjolras>
'terminal is type variable
<Enjolras>
it's like 'a
rgrinberg has joined #ocaml
<Enjolras>
maybe you can refine your question :)
<gobbledigook>
I guess I'm not really totally understanding the format?
Guest38 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<gobbledigook>
so you have "type ('terminal, 'nonterminal) symbol"
<gobbledigook>
why is 'terminal, 'nonterminal in parenthesis?
<Enjolras>
because symbol is a new type with two types parameters
<Enjolras>
when a type has more than one parameter, they are into partenthesis
<Enjolras>
that's the syntax :)
<gobbledigook>
so walk me through here
<gobbledigook>
we have a type ('terminal, 'nonterminal) symbol, is this similar to how a function takes in 2 parameters?
<Enjolras>
it's for disambiguation of "int int list symbol" and "(int, int list) symbol"
<Enjolras>
gobbledigook: this is a type, not a value in this case
<Enjolras>
it means that you can use this type as (string, string) symbol for instance, and the 'terminal type variable will be unify to the string type
<Enjolras>
and in this case the constructor T will have a string in it
jabesed has joined #ocaml
<Enjolras>
it's polymorphism
<Enjolras>
it means you can use the symbol type with any type fo 'terminal and 'nonterminal
<gobbledigook>
so is this like a C struct...?
<gobbledigook>
or enum
<Enjolras>
so ro instance N "foo" has type ('terminal, string) symbol, T 3 has type (int, 'nonterminal) symbol, and [T 4.1; N "bar"] has type (float, string) symbol list
<Enjolras>
more like an enum. But unlike C enum, each variant can have data in it, non only an integer value
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<Enjolras>
at this point,you'd better read a tutorial for ocaml which will explain these things better than me :)
<gobbledigook>
yes I am reading some as well
<gobbledigook>
I was just confused so I came on here lol
<Enjolras>
sure, you're welcome
<Enjolras>
these types are called "sum types". A simple exemple, C-like is type t = A | B; (type t is either A or B)
<Enjolras>
a more complex example is type t = C of int | D of float. A value of type t could be C 3 for instance, or D 4.7
<Enjolras>
and the case you posted is more complex because it is polymorphic
<gobbledigook>
but why is it C 3 or D 4.7?
<gobbledigook>
why can't a value of type t be just either an int or a float?
<Enjolras>
that's the point of sum types. You can add a "name". C or D is a name
<gobbledigook>
so C and D are essentially aliases for int and float?
<Enjolras>
it's very powerful. Thanks to this name you can do for instance pattern matching
jeffmo has joined #ocaml
<Enjolras>
gobbledigook: no, it's a "name" and the value, like int or float
<Enjolras>
both are stored in memory
<Enjolras>
so that you can distinguish them at runtime for instance
<gobbledigook>
oh!
<gobbledigook>
so like a typedef?
abbe has joined #ocaml
<Enjolras>
there is nothing like that in C
nullcatxxx_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<gobbledigook>
hm
<Enjolras>
you would have to hack your way with something like union data { int int_val; float float_val }; enum tag { C, D }. And then T would be something like struct t { enum tag tag; struct data data }
<Enjolras>
a typedef is type alias = int;
toomuchtvrotsurb has quit [Remote host closed the connection]
<Enjolras>
example of what you can do with that : let float_of_t = function C int_val -> float_of_int int_val | D float_val -> float_val
<Enjolras>
you can see sum types as powerful C enums and pattern matching as very powerful switch/case
struktured has joined #ocaml
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 252 seconds]
toomuchtvrotsurb has joined #ocaml
LnL has quit [Ping timeout: 260 seconds]
LnL has joined #ocaml
nullcatxxx_ has joined #ocaml
jabesed has quit [Ping timeout: 240 seconds]
MercurialAlchemi has quit [Read error: Connection reset by peer]
MercurialAlchemi has joined #ocaml
__uu__ has joined #ocaml
__uu___ has joined #ocaml
__uu___ has quit [Read error: Connection reset by peer]
__uu___ has joined #ocaml
zaquest has quit [Quit: Leaving]
__uu__ has quit [Ping timeout: 265 seconds]
toomuchtvrotsurb has quit [Remote host closed the connection]
SomeDamnBody has joined #ocaml
MercurialAlchemi has quit [Read error: Connection reset by peer]
MercurialAlchemi has joined #ocaml
shinnya has joined #ocaml
tmtwd has joined #ocaml
ceryo has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
swgillespie has joined #ocaml
MercurialAlchemi has quit [Read error: Connection reset by peer]
MercurialAlchemi has joined #ocaml
psy_ has quit [Ping timeout: 240 seconds]
beverast has joined #ocaml
<beverast>
Hi! I'm having a little bit of trouble with my Ocaml installation on Debian. I've installed the prerequisite packages, but when I run ocaml odb.ml it says there's a syntax error in the file on line 4. Since I don't know the language (yet!) I can't really go in there and fix it myself haha. Any help?
Nahra has joined #ocaml
MercurialAlchemi has quit [Read error: Connection reset by peer]
MercurialAlchemi has joined #ocaml
<mahem1>
beverast: What exactly are you trying to do with it? Just install packages? As far as I am aware OPAM is the goto tools for that.
nullcatxxx_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<beverast>
Yeah I was reading around on Ocaml's website and I saw that odb is a popular tool for downloading and installing packages from OasisDB. Can I just use OPAM instead of odb?
<mahem1>
beverast: I was just thinking that OAM does look a bit more mature. But if it's "a popular tool" then I guess it is fine too. (I have only used OPAM)
<mahem1>
As for your syntax error, perhaps it was triggered becuase of an incompatible OCaml vesion? What version are you running?
<beverast>
Well if OPAM works for you then I'll just stick to that. One sec, I'll check the version...
<beverast>
OCaml version 4.02.1
sgnb` has joined #ocaml
sgnb` has quit [Read error: Connection reset by peer]
<mahem1>
Hmm, the ODB Github repo says to have OCaml >= 3.12. So you should be ok...
apache2_ has quit [Remote host closed the connection]
<mahem1>
But you are going to use OPAM are you?
apache2 has joined #ocaml
<beverast>
Yeah I'll use OPAM.
MercurialAlchemi has quit [Read error: Connection reset by peer]
MercurialAlchemi has joined #ocaml
<beverast>
While I'm here I have another question: Good materials to learn OCaml for someone who's never used a functional language before?
<beverast>
I was looking at OCaml from the Very Beginning...
<mahem1>
I really couldn't tell you. I took a "Programming Languages" course on coursera.org that was an intermediate course that introduce the SML (standard ML). So that is where I learn functional programming. The Ocaml specifically just from the guides on ocaml.org and realworldocaml.org.
mac10688 has quit [Ping timeout: 240 seconds]
<beverast>
Alright I'll just do some searching around! OCaml's site has a fairly nice list of books on the language so I probably can't go wrong getting any of those.
<beverast>
Thanks for the help by the way!
<mahem1>
beverast: Mmmmm. The main thing is just to learn how to think in a functional way in the first place.
<mahem1>
Yeah, no worries.
<mahem1>
Oh and an OPAM pro-tip: eval $(opam config env)
<mahem1>
Too many times I forget about that one.
<jmasseo>
there is the opam user setup thing
<mahem1>
Yeah, I went through that and the opam init stuff never got in my .profile.
<mahem1>
I guess I just screwed up?
<jmasseo>
i might be imagining something that didn't happen
<jmasseo>
yeah it's in mine.
<mahem1>
Oh ok. Note to self: KISS
shinnya has quit [Ping timeout: 250 seconds]
MercurialAlchemi has quit [Read error: Connection reset by peer]
MercurialAlchemi has joined #ocaml
darkf has joined #ocaml
MercurialAlchemi has quit [Read error: Connection reset by peer]
obadz has quit [Ping timeout: 240 seconds]
MercurialAlchemi has joined #ocaml
obadz has joined #ocaml
tmtwd has quit [Ping timeout: 265 seconds]
nullcatxxx_ has joined #ocaml
<gobbledigook>
can anyone here explain to me exactly how "let and" works?
<gobbledigook>
and why you don't need to close them with ;;?
nullcatxxx_ has quit [Client Quit]
<gobbledigook>
can anyone here explain to me exactly how "let and" works?
<gobbledigook>
and why you don't need to close them with ;;?
rgrinberg has quit [Ping timeout: 246 seconds]
Mercuria1Alchemi has joined #ocaml
nullcatxxx_ has joined #ocaml
nullcatxxx_ has quit [Client Quit]
nullcatxxx_ has joined #ocaml
<dmbaturin>
gobbledigook: You don't need to use ;;'s in the code at all actually, as long as you don't use bare expressions but wrap them in the "top level" keywords such as let, open, module etc. so parser lookahead can detect where it ends.
<gobbledigook>
thanks dmbaturin, but can someone explain how "let and" works though?
<dmbaturin>
let () = print_string "hello" let () = print_endline " world" (* is unambiguous even with one token lookahead *)
<gobbledigook>
because it seems like "and" is another function
<gobbledigook>
so why not just use "let" again?
SomeDamnBody has quit [Ping timeout: 260 seconds]
<flux>
gobbledigook, 'and' is most often used in recursive definitions
<dmbaturin>
gobbledigook: Ah, (let|type) ... and are for mutually recursive bindings.
<flux>
gobbledigook, because it allows the symbols to be defined at the 'same time' instead of sequentially from top to down, which would not allow referring to a symbol defined further in the code
MercurialAlchemi has quit [Read error: Connection reset by peer]
<gobbledigook>
so if I moved the "and" above the "let"
<gobbledigook>
and changed it to "let"
<gobbledigook>
would that work?
<gobbledigook>
since it would be defined before actually being referred to
MercurialAlchemi has joined #ocaml
Mercuria1Alchemi has quit [Ping timeout: 260 seconds]
<dmbaturin>
You can only have and after let or type.
<dmbaturin>
The canonical silly example: let rec even x = if x = 0 then true else odd (x-1) and odd x = if x == 0 then false else even (x-1)
struk|desk has joined #ocaml
<flux>
gobbledigook, yes, it would work
nullcatxxx_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
nullcatxxx_ has joined #ocaml
<dmbaturin>
gobbledigook: If bindings or typed refer to one another as in the odd/even example above, "and" is requires as otherwise the compiler would complain about unbound values.
<dmbaturin>
Use of "and" to write definitions "upside down" (refer to bindings that are defined later, but do not refer to earlier bindings) is a bit controversial, but it does happen.
toomuchtvrotsurb has joined #ocaml
toomuchtvrotsurb has quit [Ping timeout: 256 seconds]
Algebr has joined #ocaml
<Algebr>
I don't understand this, what seems to me, inconsistency. let ( % ) i = i + 1, and I get a syntax error for %10, I have to do ( % ) 10, but this is clearly not the case for !, !foo works fine. So why does ! get special treatement
nullcatxxx_ has quit [Ping timeout: 264 seconds]
nullcatxxx_ has joined #ocaml
toomuchtvrotsurb has joined #ocaml
__uu__ has joined #ocaml
__uu___ has quit [Ping timeout: 250 seconds]
dysinger has joined #ocaml
toolslive has joined #ocaml
MercurialAlchemi has quit [Read error: Connection reset by peer]
MercurialAlchemi has joined #ocaml
<gobbledigook>
so I need a bit more help understanding this function:
<gobbledigook>
let function arg1 arg2 arg3 = match arg1 with
<gobbledigook>
| (a, b) -> function_check a b (b a) arg2 [] arg3;;
<gobbledigook>
let function_check a b b_matching_a arg2 der arg3 = ...
<gobbledigook>
I don't fully understand what exactly function_first is trying to do
nullcatxxx_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<gobbledigook>
so when arg1 is of the pattern (a, b) where a and b can be anything from an int to list
<gobbledigook>
it goes into function_check passing "a" for function_check's arg "a", "b" for f_c's "b", but then what does (b a) do?
<toolslive>
you could write that as let function (a,b) arg2 arg3 = function_check a b (b a) arg2 [] arg3;;
<toolslive>
b is a function
<toolslive>
(b a) evaluates b with a as argument
<gobbledigook>
ah, okay
<gobbledigook>
thanks @toolslive
nullcatxxx_ has joined #ocaml
nullcatxxx_ has quit [Client Quit]
dysinger has quit [Remote host closed the connection]
canhtak has joined #ocaml
larhat1 has quit [Quit: Leaving.]
rgrinberg has joined #ocaml
rgrinberg has quit [Ping timeout: 240 seconds]
beverast has quit [Ping timeout: 268 seconds]
<def`>
Algebr: precedence and associativity of operators follow some lexical conventions
__uu___ has joined #ocaml
__uu__ has quit [Read error: Connection reset by peer]
canhtak has quit [Quit: canhtak]
ygrek has joined #ocaml
obadz has quit [Ping timeout: 272 seconds]
toomuchtvrotsurb has quit [Ping timeout: 244 seconds]
AltGr has joined #ocaml
obadz has joined #ocaml
Haudegen has quit [Ping timeout: 264 seconds]
huza has joined #ocaml
Haudegen has joined #ocaml
__uu__ has joined #ocaml
antkong has quit [Quit: antkong]
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
swgillespie has joined #ocaml
swgillespie has quit [Client Quit]
_habnabit has quit [Remote host closed the connection]
__uu___ has quit [Ping timeout: 255 seconds]
AltGr has left #ocaml [#ocaml]
AlexRussia has quit [Quit: WeeChat 1.4-dev]
toolslive has quit [Quit: Leaving]
aftershave has joined #ocaml
_habnabit has joined #ocaml
struktured has quit [Ping timeout: 244 seconds]
mobius-eng has joined #ocaml
ygrek has quit [Ping timeout: 244 seconds]
ely-se has joined #ocaml
__uu__ has quit [Read error: Connection reset by peer]
__uu__ has joined #ocaml
__uu__ has quit [Client Quit]
keen______ has quit [Read error: Connection reset by peer]
keen______ has joined #ocaml
damason has quit [Ping timeout: 272 seconds]
sh0t has joined #ocaml
rgrinberg has joined #ocaml
mort___ has quit [Ping timeout: 246 seconds]
mort___ has joined #ocaml
rgrinberg has quit [Ping timeout: 260 seconds]
mort___ has quit [Quit: Leaving.]
mort___ has joined #ocaml
ollehar has joined #ocaml
mort___1 has joined #ocaml
mort___ has quit [Ping timeout: 250 seconds]
mort___1 has quit [Ping timeout: 240 seconds]
antkong has joined #ocaml
antkong has quit [Client Quit]
freehck has joined #ocaml
antkong has joined #ocaml
sh0t has quit [Ping timeout: 252 seconds]
amnn has joined #ocaml
beverast has joined #ocaml
rgrinberg has joined #ocaml
bitbckt has quit [Ping timeout: 240 seconds]
amnn has quit [Ping timeout: 265 seconds]
beverast has quit [Ping timeout: 244 seconds]
rgrinberg has quit [Ping timeout: 250 seconds]
amnn has joined #ocaml
amnn has quit [Client Quit]
bitbckt has joined #ocaml
ely-se has quit [Quit: leaving]
sh0t has joined #ocaml
Haudegen has quit [Ping timeout: 246 seconds]
sh0t has quit [Ping timeout: 246 seconds]
ely-se has joined #ocaml
uggwar has left #ocaml [#ocaml]
Haudegen has joined #ocaml
libertas has joined #ocaml
<companion_cube>
o/
huza has quit [Quit: WeeChat 0.3.8]
freehck has quit [Quit: Page closed]
freehck` has joined #ocaml
<freehck`>
Whee! I'm here via emacs irc client using https-proxy and ssl-multiplexor! :)
<freehck`>
Glad to see you all again. :)
amnn has joined #ocaml
<companion_cube>
oh noes, another emacs worshipper
<dmbaturin>
companion_cube: Personally I stand for freedom of religion and separation of toolchain and editor.
<companion_cube>
yeah, me too :p
<companion_cube>
some people spend all their live in emacs^W their editor
<companion_cube>
(it's ok, of course, I'm just joking)
<dmbaturin>
Someone ran emacs as pid 1.
amnn has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
antkong_ has joined #ocaml
antkong has quit [Ping timeout: 240 seconds]
antkong_ is now known as antkong
rgrinberg has joined #ocaml
<apache2>
hah
rgrinberg has quit [Ping timeout: 240 seconds]
ceryo has joined #ocaml
<freehck`>
companion_cube: I understand, but Emacs is not an editor. I assert that it is an operational system. :)
<freehck`>
dmbaturin: what's the perverts, aren't they? :)
<dmbaturin>
freehck`: I've seen some embedded distros where all functions are performed by a single blob that runs as pid 1 and starts from initrd. Running emacs as pid 1 looks sane by comparison, at least it's modular.
antkong has quit [Quit: antkong]
ely-se has quit [Quit: leaving]
<dmbaturin>
Technically, it should be possible to port emacs lisp interpreter to mirage.
<freehck`>
But I should note that Emacs lacks of multithreading. It's a specifically single-process thing due to some inherited problems.
<freehck`>
So it's not sane to use it as PID 1 I think.
<freehck`>
btw, i heared there're some Emacs forks which are better with it. Is here somebody who tried them?
<dmbaturin>
I've used the original TECO-based emacs (on an emulated PDP-10 running TOPS-20). Not sure if I should be proud or ashamed. ;)
<mobius-eng>
ClozureCL uses Common Lisp Emacs fork for their IDE on Mac OS X
<dmbaturin>
I'd like to see a Scheme Emacs.
<mobius-eng>
MIT-Scheme has Edwin: Scheme fork of Emacs (but based on Emacs 18)
ely-se has joined #ocaml
<mobius-eng>
There is some work guile scheme based emacs fork, but I don't know its stat
Nahra has quit [Remote host closed the connection]
Nahra has joined #ocaml
jabesed has joined #ocaml
<apache2>
dmbaturin: busybox?
Haudegen has quit [Ping timeout: 255 seconds]
<dmbaturin>
apache2: No, that would be too sane. Systems in questions had everything up to and including a telnet implementation linked into a single blob.
mengu has joined #ocaml
mengu has joined #ocaml
mengu has quit [Changing host]
<apache2>
busybox has telnetd :)
<apache2>
and httpd
<dmbaturin>
It used not to. Now it needs an emacs.
<apache2>
D
<apache2>
:D
Haudegen has joined #ocaml
mearnsh has quit [Ping timeout: 250 seconds]
mearnsh has joined #ocaml
mobius-eng has quit [Ping timeout: 268 seconds]
_andre has joined #ocaml
rgrinberg has joined #ocaml
mobius-eng has joined #ocaml
toolslive has joined #ocaml
toolslive has quit [Remote host closed the connection]
<jmasseo>
CLozureCL has one called 'CLimax' and I think it's derived from original -macs, like symbolics and stuff. I played with a symbolics VM and it had something called 'ZMACS'
ely-se has joined #ocaml
thomasga has joined #ocaml
zol has joined #ocaml
octachron has quit [Ping timeout: 256 seconds]
ely-se has quit [Client Quit]
<jmasseo>
After using Symbolics, emacs makes a lot more sense. heh
sgnb`` has joined #ocaml
Algebr` has joined #ocaml
flx has joined #ocaml
cojy_ has joined #ocaml
mehdi___ has joined #ocaml
jimt_ has joined #ocaml
mahem1_ has joined #ocaml
rks`_ has joined #ocaml
eagleflo_ has joined #ocaml
maufred_ has joined #ocaml
def`_ has joined #ocaml
rfv_ has joined #ocaml
TallerGhostWalt_ has joined #ocaml
edwin2 has joined #ocaml
rwmjones_ has joined #ocaml
rks`_ is now known as rks_
marsam has quit [*.net *.split]
Algebr has quit [*.net *.split]
darkf has quit [*.net *.split]
sgnb` has quit [*.net *.split]
ggherdov has quit [*.net *.split]
flxx has quit [*.net *.split]
mahem1 has quit [*.net *.split]
eagleflo has quit [*.net *.split]
jimt has quit [*.net *.split]
maufred has quit [*.net *.split]
mawuli has quit [*.net *.split]
alpen- has quit [*.net *.split]
edwin has quit [*.net *.split]
mehdi__ has quit [*.net *.split]
neferty has quit [*.net *.split]
segmond has quit [*.net *.split]
cojy has quit [*.net *.split]
def` has quit [*.net *.split]
rks` has quit [*.net *.split]
rfv has quit [*.net *.split]
rwmjones has quit [*.net *.split]
TallerGhostWalt has quit [*.net *.split]
edwin2 is now known as edwin
<Algebr`>
def`: So how can I get my unary % function to work?
darkf has joined #ocaml
rks_ is now known as rks`
<freehck`>
Algebr`: what's the question?
<freehck`>
Algebr`: let (%) a b = let num = a / b in a - b*num;; ??
neferty has joined #ocaml
<freehck`>
13 % 2;;- : int = 1
slash^ has joined #ocaml
freehck` is now known as freehck
<Algebr`>
I don't understand this, what seems to me, inconsistency. let ( % ) i = i + 1, and I get a syntax error for %10, I have to do ( % ) 10, but this is clearly not the case for !, !foo works fine. So why does ! get special treatement
cojy_ is now known as cojy
<companion_cube>
it's simply that (%) is a binary operator, I think
Haudegen has quit [Ping timeout: 244 seconds]
<Algebr`>
companion_cube: I want to make a unary operator, like ! is.
<companion_cube>
in OCaml the operator is binary or unary based on its first char
<Drup>
you can't
<apache2>
what is a unary operator?
<apache2>
it takes only ne value?
ggherdov_ has joined #ocaml
<flux>
algebr`, how would it even work, given currying?
<flux>
automatically detect the arity of an operator and then decode if syntax a%b or %a should be used for it?
<def`_>
if then else as an operator would be mixfix
<Drup>
oh, agda documentation :3
rwmjones_ is now known as rwmjones
<Algebr`>
Drup: sounds a little odd to call this "Lexical conventions" since its not a convention, its the actual rules enforced.
Haudegen has joined #ocaml
amnn has joined #ocaml
<flux>
read it like "the ocaml convention for applying arguments is adding them after the arguments after the value they are to be applied to"
<flux>
simply a statement of how things work, not that how they are "enforced" :-)
<flux>
oops, that quotation didn't follow the conventions of the english language.. :)
<Algebr`>
lol
ygrek has joined #ocaml
<mfp>
does anybody have the --criteria option to be given to opam so that it doesn't try upgrading everything when you only want to up/downgrade one package?
<mfp>
I'm getting "External solver failed with inconsistent return value." even when taking the default values documented in opam help install
<Drup>
mfp: there is a "conservative" setting, I think
<Drup>
it's in the opam documentation, under "tips", or something like that
<mfp>
(I wanted to remove -notuptodate(solution) from there)
<mfp>
(the opam help install docs were wrong, at least on 1.2.1, will submit issue)
mawuli has joined #ocaml
<mfp>
ygrek: I'm observing garbage being sent by ocurl in multipart POST (CURLOPT_HTTPPOST) request. I believe it's happening because of some change between 0.7.2 and 0.7.5. Does that ring any bells?
<mfp>
(I'm trying to confirm by downgrading to 0.7.2 right now)
Algebr` has quit [Remote host closed the connection]
<mfp>
ygrek: confirmed. Garbage being sent in multipart POST with 0.7.5, not with 0.7.2. Looks like the OCaml strings are being moved by the GC unbeknownst to libcurl.
<ygrek>
hm, iirc I did some refactoring there recently
<ygrek>
maybe you can use CURLFORM_CONTENTS instead of CURLFORM_BUFFER?
<mfp>
will try
<mfp>
why was that CURLFORM_PTRCONTENTS safe again?
<ygrek>
case CURLFORM_PTRCONTENTS:
<ygrek>
current_form->flags |= HTTPPOST_PTRCONTENTS; /* fall through */
<ygrek>
case CURLFORM_COPYCONTENTS:
<ygrek>
if(current_form->value)
<mfp>
I don't remember why I'm using CURLFORM_BUFFER instead of CURLFORM_CONTENTS -- might have been my mistake --, need to reread the API docs
<ygrek>
(and that api is horrible)
<mfp>
where's that? libcurl itself?
<ygrek>
yeap
<mfp>
gotcha
<ygrek>
actually BUFFERPTR also looks correct, I dunno now, need to run, will look closely later
<mfp>
uh but then what about this ->
<mfp>
CURLFORM_PTRCONTENTS -> .... libcurl will use the pointer and refer to the data in your application, so you must make sure it remains until curl no longer needs it.
<mfp>
vs CURLFORM_COPYCONTENTS libcurl copies the provided data, so your application doesn't need to keep it around after this function call.
<apache2>
do you have to use curl? isn't there a pure ocaml http client?
<apache2>
cohttp or whatever?
<mfp>
are the docs plain wrong?
johnf has joined #ocaml
<mfp>
apache2: well, I had code using ocurl running just fine until this, so would rather keep it and not rewrite against cohttp :-)
<ygrek>
argh
<ygrek>
indeed
<ygrek>
they are copying later
<ygrek>
looking at the flag
<ygrek>
mfp, I think thats a bug
<ygrek>
but you are using BUFFER not CONTENT so why
<mfp>
not handy, essentially using Curl_lwt_ez.post_multipart with the contents I gave above should do (if there's enough GC work going on)
<mfp>
will try to create a self-contained one
ollehar has joined #ocaml
psy_ has joined #ocaml
ollehar1 has joined #ocaml
ollehar has quit [Ping timeout: 256 seconds]
ollehar1 is now known as ollehar
antkong has quit [Quit: antkong]
pacmann has joined #ocaml
toomuchtvrotsurb has joined #ocaml
octachron has quit [Quit: Leaving]
Guest38 has joined #ocaml
ygrek has quit [Ping timeout: 260 seconds]
tani has joined #ocaml
hcarty has joined #ocaml
<hcarty>
Aside from managing the threads themselves, is there any issue with pushing aside Lwt threads with Lwt.async?
^elyse^ has quit [Quit: Leaving]
<hcarty>
Potentially with a few thousand threads
larhat1 has joined #ocaml
nullcatxxx_ has joined #ocaml
<mfp>
hcarty: you mean in terms of scalability? none
rgrinberg has quit [Ping timeout: 250 seconds]
<hcarty>
mfp: Thanks
<pacmann>
I'm implementing a Graph module and I've a Vertex module in it. The Vertex module have a type t and a compare function. To build an abstract data structure I'd like to use a functor for the Vertex module, but I don't know how to do it. Can anybody help me? http://pastebin.com/Db8TnFEH
lobo has joined #ocaml
rgrinberg has joined #ocaml
^elyse^ has joined #ocaml
canhtak has joined #ocaml
ygrek has joined #ocaml
eni_ has joined #ocaml
octachron has joined #ocaml
marsam has quit [Remote host closed the connection]
<octachron>
pacmann, you need to use your Vertex module as an argument for you graph functor
<octachron>
something like module Graph(Vertex: VertexSig) = struct ... end
alexshendi has joined #ocaml
eni_ has quit [Read error: No route to host]
eni_ has joined #ocaml
quelqun_dautre has left #ocaml [#ocaml]
eni_ has quit [Client Quit]
Kakadu has joined #ocaml
darkf has quit [Quit: Leaving]
smallfoot- has joined #ocaml
<smallfoot->
What file extension does ocaml have?
<Drup>
.ml
<smallfoot->
thanks
<Drup>
(and .mli)
smallfoot- has left #ocaml ["Leaving"]
<jmasseo>
mll and mly for the lexx/menhir bit.
octachron has quit [Quit: Leaving]
orbifx has joined #ocaml
<orbifx>
hello all
<orbifx>
been a while
<companion_cube>
\o orbifx
<orbifx>
hey companion_cube
<orbifx>
how are things?
<companion_cube>
good, thanks
<companion_cube>
how about you?
alexshendi has left #ocaml ["Leaving"]
<orbifx>
good, been off side tracked from IRC and OCaml for a while.
<orbifx>
Now I have to remember where I was and what I was doing
<companion_cube>
yeah, it's unhealthy not to write OCaml for too long
<orbifx>
ahahah
<orbifx>
indeed
<orbifx>
what have you been upto companion_cube ?
nullcatxxx_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
slash^ has quit [Read error: Connection reset by peer]
<Mercuria1Alchemi>
I want to toString() implementations because I shouldn't have to try/catch every bloody rich exception in order to print it in a human readable way
rgrinberg has quit [Ping timeout: 256 seconds]
<companion_cube>
orbifx: new job, with a lot of OCaml :p
sh0t has quit [Ping timeout: 250 seconds]
<Mercuria1Alchemi>
companion_cube: you moved, didn't you?
<hcarty>
Is there a way to inspect the contents of a Lwt_mvar.t without affecting its state? An equivalent to val is_empty : 'a Lwt_mvar.t -> unit
<hcarty>
Or another module which provides something similar functionality
<companion_cube>
Mercuria1Alchemi: yes, to Nancy
<hcarty>
s/something //
<Mercuria1Alchemi>
companion_cube: must be quite the change from Paris
<companion_cube>
it's nice, there are trees and I have a nice walk to work
nullcatxxx_ has joined #ocaml
<companion_cube>
also, it's less expensive ;)
<orbifx>
sweet companion_cube
<companion_cube>
didn't know I was sweet
<Mercuria1Alchemi>
yeah, mostly anything is less expensive than Paris, especially in terms of housing
<orbifx>
companion_cube: was referring to your new job :P
<companion_cube>
:p
<orbifx>
maybe I gotta move to FR and get me some ocaml job
<orbifx>
Do French people speak Ocaml? :P
<companion_cube>
of course they do :p
_andre has quit [Quit: leaving]
<orbifx>
I knew it
<Mercuria1Alchemi>
yeah well
<Mercuria1Alchemi>
I wouldn't say it's widespread or anything
antkong has joined #ocaml
<pacmann>
I've an error at line 20. Can someone help me to understand why I can't do that?
<pacmann>
I've copypasted your code into the toplevel and I still get that error. By the way, if i don't use the functor (if i write the module Vertex just like Edge) it works.
<pacmann>
"works" as "the toplevel doesn't give me error messages"
<orbifx>
I get `ocamlfind: Package `camlp4.quotations' not found` but I have camlp4 installed?! 0o I'm on Arch. Any thoughts are welcome.
<companion_cube>
probably the fault of opam's system switch
<companion_cube>
don't use it
<orbifx>
You mean install opam's (which is what I'm trying now)
JuggleTux has quit [Client Quit]
psy_ has quit [Read error: No route to host]
psy_ has joined #ocaml
psy_ has quit [Max SendQ exceeded]
psy_ has joined #ocaml
xiaolin has quit [Ping timeout: 250 seconds]
xiaolin has joined #ocaml
Mercuria1Alchemi has quit [Ping timeout: 260 seconds]
marsam has quit [Remote host closed the connection]
marsam has joined #ocaml
rgrinberg has joined #ocaml
gobbledigook has joined #ocaml
antkong has quit [Quit: antkong]
freehck has quit [Remote host closed the connection]
<apache2>
and if mem takes an argument you can't do "Printf.printf "%B \n" mem l 3" like that; it'll get interpreted as Printf.printf "%B \n" (mem) (l) (3)
<apache2>
you need to either do `Printf.printf "%B \n" @@ mem l 3` or `Printf.printf "%B \n" (mem l 3)`
<chindy>
apache2, why do i need in ?
<udz>
@chindy because you are let-in-ing your function into the print function
<apache2>
chindy: you can leave out the "in" if you're doing this in the "top" scope of a file
<apache2>
but it still needs to be defined before its first usage
<udz>
You are calling printf where in printf you are let-in-ing your function into the print function.
<udz>
^ what apache2 said
<udz>
I think convention is to keep it very purely functional to let-in statements in situations like print. Try to avoid doing stuff imperatively...
<apache2>
this website runs it in the toplevel (like running in `utop`); it's not compiling it from a file
jgjl has joined #ocaml
<udz>
and reynir - thanks - I'm looking more for documentation though on ocamlyacc/menhir - like do you know how to link my lexer with it so I can intepretaively check the validity of my grammar.
<apache2>
chindy: this is not your fault, but in the toplevel you need ;; to separate such expressions: https://ideone.com/5Ol7tn
<reynir>
Ah
<udz>
chindy: usually, however, (and I'm not sure if I'm correct - apache2 may know more than me) - when you are not working in the toplevel, you should try to keep everything pure.
^elyse^ has quit [Quit: Leaving]
<udz>
reynir: yeah, it's like - here's my language (a b c) - what is my resultant abstract syntax tree?
<udz>
*my expression
travisbrady has joined #ocaml
<chindy>
apache2, udz thx ...
<chindy>
yea that printf was just there so i can test if my function works... :P