hikozaemon has joined #ocaml
pango has quit [Remote closed the connection]
pango has joined #ocaml
semi has quit [Nick collision from services.]
semi has joined #ocaml
semi has quit [Nick collision from services.]
semi_ has joined #ocaml
cmeme has quit ["Client terminated by server"]
cmeme has joined #ocaml
kcollins has joined #ocaml
kcollins has quit [Remote closed the connection]
hikozaemon has quit ["Leaving..."]
shawn has quit [Connection timed out]
shawn has joined #ocaml
hikozaemon has joined #ocaml
pango_ has joined #ocaml
pango has quit [Remote closed the connection]
hikozaemon has left #ocaml []
dark_light has joined #ocaml
jcreigh has joined #ocaml
jcreigh has quit ["Cuius rei demonstrationem mirabilem sane detexi. Hanc marginis exiguitas non caperet."]
smimou has joined #ocaml
khaladan has quit [Remote closed the connection]
khaladan has joined #ocaml
postalchris has joined #ocaml
Snark has joined #ocaml
shekmalhen has joined #ocaml
ramkrsna has quit ["Leaving"]
ramkrsna has joined #ocaml
pango_ has quit [Remote closed the connection]
slipstream has joined #ocaml
slipstream-- has quit [Connection timed out]
mnemonic has joined #ocaml
shekmalhen has quit ["bêêêêêêh"]
pango has joined #ocaml
mnemonic has quit ["leaving"]
love-pingoo has joined #ocaml
love-pingoo has quit [Remote closed the connection]
<
postalchris>
Posted on this a few days ago, but I still can't make it work...
<
postalchris>
ocamlc -ccopt -L~/src/cil.my/obj/x86_WIN32 -I ~/src/cil.my/obj/x86_WIN32 -c foo.ml
<
postalchris>
File "foo.ml", line 70, characters 0-8:
<
postalchris>
Unbound module Cil
<
postalchris>
% ls ~/src/cil.my/obj/x86_WIN32/cil.*
<
postalchris>
In summary: cil.cmi/o/x/a are included via -I, and I still get unbound module.
<
postalchris>
ANyone?
<
postalchris>
Don't make me beg.
<
dylan>
you need to have cil.cmx mentioned on the command line
<
dylan>
ocamlc -ccopt -L~/src/cil.my/obj/x86_WIN32 -I ~/src/cil.my/obj/x86_WIN32 cil.cmx -c foo.ml
<
postalchris>
Nope. Doesn't work
<
zvrba>
which shell are you using?
<
postalchris>
bash inside emacs inside cygwin
<
postalchris>
I'm blaming my ocaml install (which is the Win32 native version) and trying again with the cygwin ocaml package
<
zvrba>
try ls ~/src/cil.my/obj/x86_WIN32 and see if it can find it
<
zvrba>
well, there you go.. start fixing it.
<
zvrba>
compile under cygwin for starters
<
postalchris>
I did compile under cygwin... but it seems CIL might have weird problems with the Win32 Ocaml
Boojum has joined #ocaml
Snark has quit [Read error: 110 (Connection timed out)]
<
postalchris>
OK, now it works. I don't like that I had to go nuclear...
<
postalchris>
Thanks zvrba
Boojum is now known as Snark
Oatmeat|umn has quit [Read error: 110 (Connection timed out)]
t9k248 has joined #ocaml
Oatmeat|umn has joined #ocaml
<
t9k248>
i would like to ask.. how can i define a recursive lambda ?
<
smimou>
what do you mean by this ? a recursive function ?
<
smimou>
let rec fact n = if n = 0 then 1 else n * (fact (n-1))
<
smimou>
this is the standard example of a recursive function if that's what you meant
<
t9k248>
yes, but a recursive anonymous function
<
smimou>
I don't think this is possible but you can always do use smth like
<
smimou>
(let rec fact n = ... in fact)
<
t9k248>
hmm ok thanks
t9k248 has left #ocaml []
<
dylan>
you could use a y combinator.
pango has quit ["Leaving"]
thakis has joined #ocaml
<
thakis>
hi folks. is it possible to do string matching with match?
<
thakis>
ie, something like the following haskell code:
<
thakis>
let rec solve s =
<
thakis>
match s with
<
thakis>
| "0" -> "0"
<
thakis>
| "1" -> "1"
<
thakis>
| "0" ^ r -> "0" ^ r
<
thakis>
| "10" ^ r -> "11" ^ (solve s)
<
thakis>
| "11" ^ r -> "10" ^ (invert s);;
<
flux__>
you mean substring matching? no
pango has joined #ocaml
<
flux__>
I can see two alternatives: convert strings to a list or a stream
<
flux__>
or use Pcre regular expression matching (with match-like syntax)
<
thakis>
flux__: thanks (that's what I'm doing atm)
mwc has joined #ocaml
<
thakis>
what's the shortest way to say
<
thakis>
invert '0' = '1'
<
thakis>
invert '1' = '0'
<
thakis>
(ie a function that yields '1' for '0' and vice versa. I don't care about the other values)
<
zmdkrbou>
function '0' -> '1' | '1' -> '0'
<
thakis>
and if I want to name it? put an "invert = " in front?
<
zmdkrbou>
let invert = <what i said>
<
thakis>
# let invert = fun '0' -> '1' | '1' -> '0';;
<
thakis>
Syntax error
<
zmdkrbou>
function
<
thakis>
nevermind, just saw that myself
<
zmdkrbou>
("function" is the same as "fun x -> match x with")
<
thakis>
is there a built-in function that calls another function n times?
<
zmdkrbou>
n times a function of type unit -> unit ?
<
zmdkrbou>
(or 'a -> unit)
<
thakis>
'a -> unit
<
thakis>
no, unit->unit
<
zmdkrbou>
i don't think there is
<
zmdkrbou>
usually, you apply it on a list
<
thakis>
I have a file that has a number in the first line and then as many strings after it
<
thakis>
i read the number and then want to call a function n times that reads one line and does something with it
<
zmdkrbou>
you can use a recursive function then
<
thakis>
I currently have a recursive function, but it's a bit "wordy"
<
thakis>
it does what I want to, but it takes as much code as the c++ version I've written before
<
thakis>
(it's a solution to spoj.sphere.pl/problems/LWAR/ if you're wondering)
mwc has quit ["Leaving"]
<
zmdkrbou>
well it does not take advantage of functional programming
<
zmdkrbou>
because strings are not list in ocaml
<
zmdkrbou>
(which sucks)
<
thakis>
yes, this sucks in a number of languages :-P
_JusSx_ has joined #ocaml
bzzbzz has joined #ocaml
finelemo1 has joined #ocaml
finelemon has quit [Read error: 113 (No route to host)]
<
pango>
thinking of it, using f (invert t) instead of f_invert t and dropping f_invert should work just fine, just slower
thakis has quit ["Computer goes to sleep!"]
thakis has joined #ocaml
<
thakis>
pango: can you send that again please?
<
thakis>
hey, thanks :-)
desc has joined #ocaml
<
thakis>
what's the "let _ = " good for?
<
semi_>
ignoring return value
<
semi_>
otherwise you get warnings when calling something that tries to return something
<
pango>
introduce a sequence, without resorting to using ;;
descender has quit [Read error: 60 (Operation timed out)]
<
pango>
but you can replace it with an explicit ;; if you prefer that style
bzzbzz has quit ["leaving"]
<
thakis>
thanks again...g'night
thakis has quit ["Quitting!"]
Snark has quit ["Leaving"]
desc is now known as descender
Wild_Cat has joined #ocaml
Wild_Cat has quit ["tiuq\"]
_JusSx_ has quit ["leaving"]
smimou has quit ["bli"]
khaladan has quit [Read error: 104 (Connection reset by peer)]