twittard has quit [Remote host closed the connection]
twittard has joined #ocaml
iago has quit [Quit: Leaving]
fantasticsid has joined #ocaml
oriba has quit [Quit: oriba]
avsm has quit [Quit: Leaving.]
twittard has quit [Ping timeout: 244 seconds]
twittard has joined #ocaml
twittard has quit [Quit: twittard]
fantasticsid has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
emmanuelux has quit [Read error: Connection reset by peer]
yroeht has quit [Ping timeout: 255 seconds]
yroeht has joined #ocaml
EmmanuelOga has quit [Ping timeout: 245 seconds]
ulfdoz has quit [Ping timeout: 240 seconds]
ankit9 has quit [Quit: Leaving]
fantasticsid has joined #ocaml
zuymanto has joined #ocaml
zuymanto has quit [Client Quit]
Snark has joined #ocaml
Submarine has joined #ocaml
Submarine has quit [Changing host]
Submarine has joined #ocaml
pango has quit [Remote host closed the connection]
<dsheets>
anybody know what part of menhir I should prod to get error information after I catch an Error exception from a menhir-generated parser?
<dsheets>
I'm using traditional2revised and wrote the appropriate projection functions from 'token to Lexing.position… i just don't know where to retrieve those values, now
ftrvxmtrx has quit [Quit: Leaving]
twittard has joined #ocaml
edwin has joined #ocaml
thomasga has joined #ocaml
ftrvxmtrx has joined #ocaml
avsm has joined #ocaml
cago has joined #ocaml
ankit9 has joined #ocaml
djcoin has joined #ocaml
Cyanure has joined #ocaml
twittard has quit [Ping timeout: 260 seconds]
twittard has joined #ocaml
eikke has joined #ocaml
ankit9 has quit [Quit: Leaving]
Submarine has quit [Ping timeout: 245 seconds]
Submarine has joined #ocaml
Cyanure has quit [Remote host closed the connection]
<Ptival>
I'm currently correcting style in someone's code in other to be able to read it :D
<Ptival>
s/other/order/
<adrien>
my biggest issue is tabs+space ='(
<adrien>
I often start commits by throwing a huge change that only changes indentation ='(
<Ptival>
I have more problems with stuff being all on one line
<Ptival>
like the first case of a match, or the then clause of an if...
<Ptival>
I find it super annoying
<Ptival>
visually-dangling elses
<Ptival>
maybe I should send the link to this guidelines page to the author
<adrien>
heh
Tobu has joined #ocaml
lamawithonel_ has quit [Ping timeout: 276 seconds]
<NaCl>
adrien: how anti-emacs of you
<adrien>
nah: pro-sense
<adrien>
or "meaningful"
lamawithonel has joined #ocaml
<NaCl>
sense? what's that?
<adrien>
sense: what java doesn't make
<Ptival>
NaCl: what were you referring to?
<adrien>
emacs is typically the editor that leads to a mix of tabs and spaces in source codes
<Ptival>
k
<Ptival>
adrien: I do that too :p
<adrien>
I use vim; NaCl uses emacs ;-)
* adrien
spanks Ptival
<Ptival>
I use emacs with evil
<Ptival>
for OCaml
<Ptival>
and Coq/Agda
<Ptival>
vim for the rest
<adrien>
in ocaml, it really makes no sense
<Ptival>
but tabs are only allowed in Makefiles!
<adrien>
it only happens that it "compresses" 8 spaces as one tab
<adrien>
Ptival: yes, there; but not a mix anyway
<adrien>
anywhere*
<Ptival>
spaces everywhere else!
<NaCl>
emacs has sane defaults
<NaCl>
except for the tab/space thing
<NaCl>
wrt indentation
<NaCl>
I use emacs for everything that I need to have open for more than a few minutes
<adrien>
I'll adapt to anything
<adrien>
except mixes of tabs and spaces
<adrien>
NaCl: ah, so the startup time doesn't become too dominant? =)
<Ptival>
the only use of tabs is to be able to set the size, if you mix in spaces you're doing it very wrong...
<NaCl>
I haven't my work emacs sessions in weeks
<NaCl>
Ptival: the idea is to make alignment independent of tab length
<Ptival>
adrien: hahaha
<NaCl>
haven't closed
<adrien>
NaCl: yeah ;-)
<adrien>
but actually, on an empty cache, vim takes a *LOT
<adrien>
* of time to start here
Tobu has quit [Quit: No Ping reply in 180 seconds.]
<djcoin>
I'm a Vim fan but thats true that emacs major:minor mode are great. I use emacs for Latex myself
<adrien>
when I say "empty", I mean really empty
Tobu has joined #ocaml
<NaCl>
I use evil in emacs
<NaCl>
because I use the arrow keys
<pippijn>
adrien: same here, it takes a few seconds
<f[x]>
I use vim with kindness
<adrien>
vim 0.20s user 0.29s system 9% cpu 5.084 total
<pippijn>
about the same time as emacs
<pippijn>
vim 0.14s user 0.04s system 8% cpu 2.107 total
<adrien>
time sto start and and be closed at once (I could type ":q" in the terminal before vim had started so it got picked at once)
<adrien>
pippijn: if you want an empty cache: echo 3 > /proc/sys/vm/drop_caches
<adrien>
it will slow down your computer during some time
<pippijn>
adrien: nice
<pippijn>
I didn't know about that
<adrien>
mostly useful for benchmarks
<NaCl>
my emacs takes a few seconds to start up. :P
<pippijn>
vim 0.07s user 0.04s system 2% cpu 3.901 total
<adrien>
note that with that, your cache will be much colder than after a fresh reboot
<pippijn>
wrong
<pippijn>
vim 0.12s user 0.11s system 2% cpu 9.722 total
<pippijn>
the other one was the 32 bit vim
ankit9 has quit [Quit: Leaving]
<pippijn>
and ctags is not installed there
<pippijn>
emacs 0.14s user 0.09s system 4% cpu 4.627 total
<adrien>
well, my point was mainly that you can make anything very slow if you have an empty cache
<djcoin>
not sure measuring accuratly memory usage of emacs vs vim, is a great criteria. I will give most of what I can give to an editor if it can make me more efficient.
<adrien>
it reminds me of ff's way to speedup loading
<pippijn>
preload?
<djcoin>
accurately *
<adrien>
basically, the "firefox" binary is now a binary the does "cat $lib > /dev/null" for each library that firefox uses
<pippijn>
heh
<adrien>
it triggers sequential reads instead of random ones
<pippijn>
not bad
<pippijn>
by the way, does ocaml support shared libraries?
<NaCl>
make the first block an imperative statement
<NaCl>
then return buffer
<pipocaml12>
NaCl, does this function not return buffer already?
<rixed>
pipocaml12: yes it does.
<rixed>
pipocaml12: don't you mean input instead of read BTW?
<pipocaml12>
because it does copy recursively and when there is nothing left to copy()
<pipocaml12>
read is a unix socket function. This code is copied from the Ocaml book on Unix programming
<rixed>
pipocaml12: also, you may want to use really_input
<pipocaml12>
I changed it because I only want to ready
<pipocaml12>
read
letrec has quit [Ping timeout: 245 seconds]
<pipocaml12>
but the in means that the phrase is functional and not an imperative statement, if I understand NaCl correctly?
<pipocaml12>
the "in" at the end
<rixed>
pipocaml12: ok. anyway, you have a bug: you should pass current offset to copy
<pipocaml12>
no I think reading from sockets means that the buffer is emptied, so no offset
<pipocaml12>
every time you read the buffer is getting emptied further
<pipocaml12>
or not?
<rixed>
the "in" means that the definition of copy holds in the statement "copy ()".
<pipocaml12>
offset in sockets makes no sense I suppose
<rixed>
pipocaml12: yes, but you overwrite your buffer.
<pipocaml12>
so it is like "with" in R and I think Python??
<rixed>
pipocaml12: don't know. in opens a scope where the previous definition holds, if you want.
<pipocaml12>
okay this code is not indented but am I correct to see it like a cascade with the p1 in p2 in p3, then p3 is the most powerful
<pipocaml12>
powerful ... I mean, it is the most containing scope ...
<iZsh>
pipocaml12: you should probably read more tutorials before trying to code something. you seem to be missing some basic knowledge about the ocaml language
<rixed>
pipocaml12: let a = 1 in expr -> in expr, a is defined to be 1. there is nothing in there to be afraid of, it's like english actualy. juste read the code :-)
<pipocaml12>
iZsh I would love to do tutorials if I hade more time, but I turned to OCaml because it solved a problem quite well ...
<rixed>
pipocaml12: go ahaid, one get accustomed to the syntax in a couple of hours of practice!
<pipocaml12>
I already had an idea what in meant, but I wanted to check my understanding ... and you are right that such elementary things can probably be found with Google in tutorials ... anyway
djcoin has quit [Quit: WeeChat 0.3.2]
<pipocaml12>
thx rixed
<rixed>
pipocaml12: I maintain you have a bug anyway ;-) -> copy should take offset as argument, and call "read fdin buffer offset (buffer_size-offset)"
<thelema>
asking what "in" means in ocaml is like asking what "{" means in C - it's just a delimiter
<pipocaml12>
yes but circumfix delimiters like { ... } are clearer and more evident to me at least
<rixed>
except that there are no equivalent for '}' so you have to get accustomed to the effect of ";", lets and parenths. But all in all quite easy.
<pipocaml12>
in could go both was a in b in c : a > b > c or a < b < c ... so that is why I was not so sure
<pipocaml12>
was = ways
<pipocaml12>
rixed, the buffer_size is like the chunk size, not the total size.
<pipocaml12>
or do I miss your point
eikke has quit [Ping timeout: 260 seconds]
<rixed>
the 4th parametert to read is the max size to read. If you already filled 3 bytes in your buffer, you want to read (buffer_size-3) and stores the new bytes at offset 3.
<thelema>
pipocaml12: 'in' doesn't work by itself - "a in b in c" isn't valid. "let a = x in let b = y in c" is valid; in just divides the expression to bind from the expression that uses the bound identifier
<pipocaml12>
thelema, please bear with me, I am very sloppy in my writing in this chat box ... Always a bit hasty ... I used a b c as shorthands..
<pipocaml12>
(not grammatically correct)
<thelema>
the a b and c are fine, but you need 'let' for every 'in'
<thelema>
and let is probably more important than 'in', so dropping the let and keeping the 'in' seems wrong
<pipocaml12>
I got that. So, a, b and c must be expressions or must they strictly be function applications
<pipocaml12>
oh no of course not
<thelema>
in my example, a and b are identifiers and c is an expression
<rixed>
pipocaml12: let some_binding in some_expression (where some_expression can be another let x in y)
<thelema>
in your example... a and b are "let foo = bar" strings and c is an expression
<pipocaml12>
hmm I don't get that
ulfdoz_ has joined #ocaml
ftrvxmtrx has joined #ocaml
<pipocaml12>
why is b not an expression? you define an identifier to equal an expression y
<pipocaml12>
'no assignments in Ocaml'
<pipocaml12>
so is this the pointe?
eikke has joined #ocaml
ulfdoz has quit [Ping timeout: 245 seconds]
ulfdoz_ is now known as ulfdoz
EmmanuelOga has quit [Quit: WeeChat 0.3.7-dev]
<thelema>
pipocaml12: "a in b in c" requires that a be "let foo = bar" and b be "let foo2 = bar2" and c can be an expression using foo and foo2
<thelema>
I think about it as "let a = x in let b = y in z", where a and b are identifiers, x and y and z are expressions
<thelema>
y can use "a" in it, and z can use "a" and "b"=
eikke has quit [Ping timeout: 276 seconds]
<thelema>
note that "let a = x in y" is an expression itself, so it can be used as a "y" or "z"
<pipocaml12>
well my thinking is perhaps still a bit imperative ...
<thelema>
yes, it's a bit of a change in thinking.
<pipocaml12>
because my intuition about, say: "let foo = bar in let foo2 = bar2 in let c = bar2"
<rixed>
pipocaml12: maybe you are confused because contrary to other languages, in ocaml "let a = x" in not a statement by itself. Instead, "let ... in ..." is, so that every binding comes with its "scope" (to speak loosely)
<pipocaml12>
would be that b is an expression when it is evaluated in c
<thelema>
pipocaml12: what b?
<pipocaml12>
correction "let foo = bar in let foo2 = bar2 in let c = bar2"
<pipocaml12>
I mean that bar2 is an expression when it is evaluated in the scope of c
<pipocaml12>
?
<pipocaml12>
shit
<pipocaml12>
again wrong
<thelema>
bar2 is an expression that is evaluated right when it's bound to "foo2"
<pipocaml12>
"let foo = bar in let foo2 = bar2 in let c = foo2"
<thelema>
the result of that evaluation can be used in the expression for c
<pipocaml12>
I meant to say foo2... anyway, I will try to focus my attention again not on chatting about it :P
<thelema>
ok
<pipocaml12>
but one thing
<iZsh>
"let c = foo2" alone doesnt mean anything
<iZsh>
you have to read it like english really
<thelema>
iZsh: it does at the toplevel
<iZsh>
thelema: yeah ok, but that's cheating
<thelema>
iZsh: and toplevel phrases are accepted in compiled programs, so when I write my programs, they contain "let () = main ()" without an in
<iZsh>
thelema: i usually limit the only "let" without "in" to the main, and of course the function definitions
<thelema>
iZsh: same here. I'm just saying that it's valid
<rixed>
Maybe let ... in would be easier as "with ... in" ?
<pipocaml12>
I must say that while the notation is not so explicit as much as I like, I do think I find all of this escalating the scope (that's one, probably not conventional way to describe this chaining of "in") is natural ... I'm trying to say, that I think I will appreciate and understand it better over time .. I am not put off by it, even though it is a world apart from languages like C
<thelema>
it's not an expression, it's a phrase, but it's valid
<iZsh>
pipocaml12: it is as explicit as saying it in english really
<iZsh>
let x be 2 in ...
<rixed>
pipocaml12: I came from C as well, and was afraid of the syntax initialy. After a single evening of actually using it, I found it simpler than I though and quite elegant.
<iZsh>
let x = 2 in x * 42 ( let x be 2 in x * 42 )
<pipocaml12>
yes but when you have programmed in many languages, you start to learn NOT to interpret it like English :P
<pipocaml12>
so you look for other interpretations
<iZsh>
pipocaml12: I totally and uterly disagree
<rixed>
pipocaml12: ML syntax was initialy intended for math students who were not already familiar with other programming languages, IIRC.
<pipocaml12>
anyway, it was not my main question and now we have written so much about it :P
<iZsh>
rixed: I really dislike the begin/end thing though in ocaml
<thelema>
iZsh: use () instead
<iZsh>
thelema: still ugly :)
<thelema>
you'd prefer {}?
Kakadu has joined #ocaml
<iZsh>
well, it often happens with sub matches
<thelema>
yes, match within match requires () or begin/end
<iZsh>
and it's ugly, begin match … end, is ugly
<thelema>
that said, don't be afraid to make one mega match - ocaml is very good at optimizing matching code
<iZsh>
I'd prefer, match … end (end being optional)
<rixed>
iZsh: I never use begin/end. you can use parenths everywhere, which I find more convenient.
<iZsh>
rixed: (match .. ) is still ugly
<iZsh>
my issue is having anything before the keyword "match"
<rixed>
iZsh: yes I agree for (match...).
<iZsh>
thelema: I'm not afraid for the efficiency, I just like nice readable code. so I avoid mega match :)
<thelema>
then hide the sub-match in a function?
<rixed>
iZsh: but to be fair, once you are used to OCaml you find that C's "if (cond)" is ugly as well (what for the parenth here?)
<iZsh>
thelema: not always practical nor necessary for small stuff
<iZsh>
I'd really like an optional end keyword
<iZsh>
that way, when necessary i could add a "end"
<thelema>
meh, deal with the ( before match.
<iZsh>
no way ;)
<iZsh>
it's ugly!
Cyanure has joined #ocaml
decaf has joined #ocaml
<pippijn>
is there function chaining in ocaml?
<Ptival>
pippijn: what do you mean?
<Ptival>
you can define let ( |> ) x f = f x
<Ptival>
and do: let new_stuff = stuff |> stuff_transformer_1 |> stuff_transformer_2
<pippijn>
no
<pippijn>
(trans1 . trans2) stuff
<pippijn>
to be
<pippijn>
trans1 (trans2 stuff)
<Kakadu>
let ( & ) f x = f x
<Kakadu>
print_string & string_of_int & 123
<Ptival>
pippijn: this is usually called function composition
eikke has joined #ocaml
<iZsh>
pippijn: with "batteries" you can do f -| g
silver has quit [Read error: Connection reset by peer]
decaf has quit [Ping timeout: 276 seconds]
<pippijn>
and then I can pass the result of that to another function?
<iZsh>
why couldn't you?
Kakadu has quit [Read error: Connection reset by peer]
Kakadu has joined #ocaml
<pippijn>
good
<iZsh>
what's the easiest way to know where an exception is raised ?
<_habnabit>
iZsh, programmatically?
<iZsh>
_habnabit: no, just to debug
thomasga has quit [Quit: Leaving.]
<_habnabit>
iZsh, export OCAMLRUNPARAM=b
Cyanure has quit [Ping timeout: 244 seconds]
<Drakken>
Batteries also has |- if you want to list the functions in order of evaluation
<iZsh>
_habnabit: not working (note that I am catching the exception at a higher level)
<_habnabit>
iZsh, define 'not working'
<iZsh>
it executes the program as usual
<iZsh>
I dont see any extra output
<_habnabit>
okay; that'll only output the traceback if it's completely unhandled
<_habnabit>
otherwise you'll have to use Printexc
decaf has joined #ocaml
<iZsh>
mmm the backtrace is empty when calling get_backtrace ()
<iZsh>
oops
<iZsh>
forgot to start the record
decaf has quit [Ping timeout: 276 seconds]
<_habnabit>
normally I just use Printexc.print
<iZsh>
ok great, it's working, thx!
Tobu has quit [Remote host closed the connection]
decaf has joined #ocaml
zuymanto has joined #ocaml
djcoin has joined #ocaml
eikke has quit [Ping timeout: 252 seconds]
Cyanure has joined #ocaml
pango has joined #ocaml
Kakadu has quit [Read error: Operation timed out]
zorun has joined #ocaml
eaSy60 has joined #ocaml
eikke has joined #ocaml
<adrien>
I'm looking for a _very_ quick expample of phantom types for someone who's not stupid but who doesn't know ocaml
<pipocaml12>
but the source files, including the module, are not in the download
<adrien>
for file functions, you might want to see FileUtils (ocaml-fileutils)
<pipocaml12>
only text documents
twittard_ has joined #ocaml
<pipocaml12>
I am trying to reuse some code in the sample and change it gradually. Otherwise it will take too much time, I will make my own code later
<pipocaml12>
samples
<adrien>
I don't know if this module is available; you can copy the code of the file you linked to if you abide by the QPL too
<adrien>
(at least for now as you said)
<adrien>
but what is your "high-level" goal btw?
<pipocaml12>
I want to write a small program that send a mail (in SSL layer) and that is callable from R. the mail signals a big job done in R (statistical package)
<pipocaml12>
Jython and other programming platforms that I could couple with R, do not do this. I do not want to mess in C
<pipocaml12>
the mailer function works
<pipocaml12>
but I cannot call it from R :(
<pipocaml12>
only launch shell commands in a crippled way
<pipocaml12>
so I am now trying to solve it by having a listening socket
<pipocaml12>
this listening TCP socket works also
twittard has quit [Ping timeout: 276 seconds]
twittard_ is now known as twittard
mcclurmc has joined #ocaml
<pipocaml12>
but I changed some stuff and I am frustrated with the syntax errors (without explanation from ocamlc)
<pipocaml12>
I wont spread this code of course, need to get the job done for myself and it is very insecure anyway
<adrien>
if you pastebin it, we can look at the syntax errors
* adrien
can't help for the logic though =)
<pipocaml12>
okay thx
<pipocaml12>
one more note:
<pipocaml12>
Note In the rest of this course, we use an auxiliary library Misc which contains several useful functions like try_finalize that are often used in the examples. We will introduce them as they are needed. To compile the examples of the course, the definitions of the Misc module need to be collected and compiled.
<pipocaml12>
how sad, the code samples are nowhere, you have to extract them from the tex document sources
<thelema>
pipocaml12: so just copy the text of any functions you use from the link above.
<pipocaml12>
it also refers to misc functions that are not verbatim in the tutorial
<thelema>
pipocaml12: does that link not have the misc functions you're looking for?
<pipocaml12>
yes I can use that possibly, I just encountered that one too. But strange that I really have to look there?? There must be a unintended mistake made by the authors of ocamlunix.ocamlforge.org ??
<pipocaml12>
I will check that old file now then
<thelema>
old? it was last updated on dec 28th of 2011
<thelema>
I agree it should be linked to from the ocamlunix page.
<pipocaml12>
sorry, old is the wrong word. I found that this file was removed from the current revision, maybe I did not look properly
<pipocaml12>
I will paste the (simple, short) code that I have so that you see which functions I need. They are not the file in the VCS
<pipocaml12>
moment
<pipocaml12>
sigh my internet is slow, I am trying to log in to code paste site
<adrien>
wgetpaste =)
<pipocaml12>
what is that
<adrien>
pastes from the command-line
<pipocaml12>
ideone.org as well as pastebin do not respond. I am on WiFi in a busy student complex ...
<adrien>
shout that there's free beer and pizza in some other building and everyone will leave =)
<pipocaml12>
problem is that it is in the middle of nowhere, so everyone is eating pizza in another block that sucks bandwith from the same WiFi pole ;)
<pipocaml12>
lines 226/227 need those special functions
<pipocaml12>
it seems necessary too because handling connections is asynchronous :( could do without that though
oriba has joined #ocaml
<pipocaml12>
first things first ...
<pipocaml12>
at line 193 there is syntax error
<pipocaml12>
I have changed it since I pasted it first, so refresh if you are looking at it ... but still at that same spot a syntax error
<pipocaml12>
I do not see it
<adrien>
you can' t do:
<adrien>
let foo a =
<adrien>
a;
<adrien>
';' means that there is something else coming up afterwards
<pipocaml12>
still it does not give any more information than a location. But is seems line 186 is the real problem?
<adrien>
I think camlp4 parsing would help: warnings don't help for syntax errors
smondet has joined #ocaml
<adrien>
thelema has a point too: you won't be able to run your code on ideone probably (but syntax errors are much earlier in the compilation process)
<pipocaml12>
okay line 186 .... I'm, hitting myself now. :X\
<adrien>
=)
<pipocaml12>
"let () =", () means empty tuple so it stand for a 'main' like entry point if its in the global level ... or not?
<pipocaml12>
I will reorganize it
<pipocaml12>
(BTW i'm compiling it locally not on Ideone, that is just a gimmick when you cannot change the paramters to the ocaml compiler)
<thelema>
"let () = ..." just means evaluate the following code and throw away the result (but error if the result isn't ())
<pipocaml12>
so it is translatable to a void procedure in C? a procedure, not a function?
<pipocaml12>
not a main function at least, okay
<pipocaml12>
I removed it an placed that stuff in the top level
<thelema>
like void. ocaml doesn't have a main function that returns int - every value in your program is evaluated in the order that they're in modules
<pipocaml12>
that is very elegant. No restrictive convention about returning an int to signal error conditions, I am certainly thrilled by Ocaml (might sound silly but OCaml does strike me as compact and powerful ... more than I already though)
<pipocaml12>
is -linkpkg only necessary for Unix? how can Iearn about that (I have the API doc for the Unix module open)
<thelema>
pipocaml12: it's necessary any time you're using -package
<pipocaml12>
is "open" equivalent to -linkpg for native compiled code (I would think not)? and why does "open Unix ;;" fail with Reference to undefined global `Unix'
<thelema>
not at all
<thelema>
and "open Unix" fails when ocaml can't find a module that provides unix
<pipocaml12>
in the man page for ocamlc 3.12.0, i cannot find the option -linkpkg, only -linkall
<pipocaml12>
has the name changed or am I missing somehting? I am now just using both
<edwin>
linkpkg is from ocamlfind
<pipocaml12>
oh
<pipocaml12>
I will study that better later and use ocamlbuild instead of a shell script
<pipocaml12>
how do you convert a string list to a string
<iZsh>
i want to pretty print my AST to a dot (graphviz) file. should i just do the pretty print myself, or is there a lib which could significantly make my life easier?
<pipocaml12>
I have fixed my function, can someone please give me a hint how to coerce a 'list -> string' into a string?
<pipocaml12>
let () = Printf.printf "\t%s\t%s\t%s\nsplitted:" string_of_list splitted_str in
<pipocaml12>
i thought it was something with ' .... cant find it anymore
<iZsh>
pipocaml12: list -> string is a function which take a list as a parameter and return a string
<iZsh>
so to coerce it to string, you just give it a list?
<iZsh>
print_endline (String.concat splitted_str)
<pipocaml12>
I do that as far as I know, and I got this ...
<pipocaml12>
Error: This expression has type string list -> string
<pipocaml12>
but an expression was expected of type string
<iZsh>
yes
<iZsh>
because %s espect a string
<iZsh>
and you gave it string_of_list
<pipocaml12>
okay so I give a function hehe
<iZsh>
which is a string list -> string
<pipocaml12>
I get it
<pipocaml12>
I am passing the function as value
<iZsh>
you want (string_of_list splitted_str)
<iZsh>
which is a string
<pipocaml12>
thanks
<iZsh>
but string_of_list is just String.concat
<pipocaml12>
does enclosing an expression that begins with a function name and that provides the proper arguments within parentheses always cause that function to be evaluated
<iZsh>
yes
<iZsh>
it's not a lazy language
<iZsh>
it is evaluated as soon as it can be
<pipocaml12>
" let () = Printf.printf "t%s" "test" "
<pipocaml12>
is the same as:
<pipocaml12>
(Printf.printf "%s" "test")
<pipocaml12>
?
<_habnabit>
no.
<pipocaml12>
hmm that let may not be called
<pipocaml12>
I will think it over
<iZsh>
you use the parenthesis for the priority, not to force an evaluation
edwin has quit [Remote host closed the connection]
<iZsh>
anyway, afk, reading the dot specs
<adrien>
I think there are bindings too
<pipocaml12>
let () = Printf.printf "\t%s\t%s\t%s\nsplitted:" (String.concat splitted_str) in results in an error :( I am sorry I must be making simple mistakes all the time
<adrien>
that might provide some more safety
<pipocaml12>
Error: This expression has type string list
<pipocaml12>
but an expression was expected of type string
<adrien>
plus dot won't let you write parens and dots in labels
<pipocaml12>
oh I see
<pipocaml12>
stupid
eikke has joined #ocaml
<pippijn>
are all && operators shortcut?
<pippijn>
hm, I suppose not
<pippijn>
stupid question
<pippijn>
is it possible to implement one's own shortcut operator?