caligula__ has quit [Quit: Konversation terminated!]
ulfdoz has joined #ocaml
yacks has joined #ocaml
manud has quit [Quit: manud]
manud has joined #ocaml
manud has quit [Client Quit]
ygrek has quit [Ping timeout: 246 seconds]
Arsenik has joined #ocaml
chrisdotcode__ has quit [Ping timeout: 268 seconds]
ulfdoz has quit [Ping timeout: 256 seconds]
dnm_ has joined #ocaml
Snark has joined #ocaml
wwilly has joined #ocaml
hkBst has joined #ocaml
<fds>
gasche: Yeah, that was the problem! I've (sort of) fixed that now it compiles, but when I run it and enter any expression it gives me "Parse error: illegal begin of expression", which presumably means my grammar isn't matching anything!
<fds>
I'll resume work later, now it's time for breakfast.
caligula has joined #ocaml
Arsenik has quit [Remote host closed the connection]
wwilly has quit [Read error: Connection reset by peer]
hkBst has quit [Ping timeout: 264 seconds]
hkBst has joined #ocaml
hkBst has quit [Changing host]
hkBst has joined #ocaml
dnm_ has left #ocaml []
<gasche>
fds: feel free to post your code somewhere and give the faulty input
<gasche>
(and have a good breakfast)
dnm has joined #ocaml
ggole_ has joined #ocaml
ggole_ has quit [Client Quit]
zpe has joined #ocaml
Simn has joined #ocaml
mcclurmc has joined #ocaml
<fds>
gasche: Here's my code: http://ocaml.nopaste.dk/p58263 I hope there's enough information to see what I'm trying to achieve!
<fds>
I know some bits of it aren't right (e.g., the handling of atoms), but I just wanted to get something working first.
zpe has quit [Ping timeout: 245 seconds]
ygrek has joined #ocaml
skchrko has joined #ocaml
thomasga has joined #ocaml
gautamc has quit [Read error: Connection reset by peer]
gautamc has joined #ocaml
zRecursive has quit [Remote host closed the connection]
zpe has joined #ocaml
ben_zen has quit [Ping timeout: 245 seconds]
ollehar has joined #ocaml
Guest76158 is now known as joostvb
zpe has quit [Ping timeout: 276 seconds]
<gasche>
fds: I think I have an idea what the problem may be
<gasche>
it's your use of "0" and "1" as terminals
Kakadu has joined #ocaml
<gasche>
if you use the default lexer, there has been a lexical-category-aware lexing already taking place
<gasche>
and you will never get the tokens STRING "0" or KEYWORD "0", but INT "0"
<gasche>
so you should rather use, I think the syntax is, `INT(_, 0) -> ...
<gasche>
(it's a pattern-matching on an usual token constructor INT, as a stream element (hence the `), that has two parameters, first the string representation then the integer value)
<gasche>
it's probably possible to write something like (0 = INT) as well but I don't remember the syntax
wwilly has joined #ocaml
<wwilly>
bonjour
<fds>
gasche: Aha! I think it's actually `INT(0, _), because that appears to work now. I mean, the generated code is definitely not what I want, but it looks like something I can work with!
<fds>
Thanks a lot for your help!
zpe has joined #ocaml
AltGr has joined #ocaml
zpe has quit [Ping timeout: 276 seconds]
zpe has joined #ocaml
mfp has joined #ocaml
mcclurmc has quit [Quit: Leaving.]
chrisdotcode has joined #ocaml
q66 has joined #ocaml
Yoric has joined #ocaml
mcclurmc has joined #ocaml
Yoric has quit [Ping timeout: 268 seconds]
mcclurmc1 has joined #ocaml
mcclurmc has quit [Ping timeout: 264 seconds]
mcclurmc has joined #ocaml
mcclurmc1 has quit [Ping timeout: 245 seconds]
skchrko has quit [Quit: Leaving]
Neros has joined #ocaml
zRecursive has joined #ocaml
mort___ has joined #ocaml
wwilly has quit [Ping timeout: 245 seconds]
skchrko has joined #ocaml
Yoric has joined #ocaml
_andre has joined #ocaml
wwilly has joined #ocaml
yacks has quit [Ping timeout: 276 seconds]
zRecursive has quit [Remote host closed the connection]
yacks has joined #ocaml
ygrek has quit [Ping timeout: 245 seconds]
walter|r has joined #ocaml
Yoric has quit [Ping timeout: 245 seconds]
mort___ has quit [Quit: Leaving.]
Drup has joined #ocaml
Xom has quit [Remote host closed the connection]
Xom has joined #ocaml
Drup has quit [Ping timeout: 256 seconds]
ygrek has joined #ocaml
amirmc has joined #ocaml
dsheets has joined #ocaml
dsheets has quit [Ping timeout: 264 seconds]
Drup has joined #ocaml
mort___ has joined #ocaml
Yonex has joined #ocaml
yezariaely has joined #ocaml
<yezariaely>
anyone has a link to the predefined priorities of symbol in ocaml? I know there is a document where this is described, but I can't find it right now
<n06rin>
i don't know repeat konstruction. But thank a lot
<Kakadu>
Omg
<Kakadu>
repeat is function
<Kakadu>
You probably have written it in previous exercise
<Kakadu>
> <n06rin> let repeat "_" 5 and function out is like "_____" ? Need to make it without cycles
walter|r has quit [Quit: This computer has gone to sleep]
yacks has joined #ocaml
Yoric has quit [Ping timeout: 264 seconds]
thomasga has quit [Ping timeout: 264 seconds]
<n06rin>
Kakadu, i don't understand at all. I need to make repeat, I haven't it written
<Kakadu>
me and ggole have written two versions of repeat above
<n06rin>
so, i need to think
<ggole>
An activity central to programming, yes.
<mrvn>
How about something like: let indent x = Printf.printf "%*s" x " "
darkf has quit [Quit: Leaving]
<n06rin>
guys, about what repeat are you talking?
tianon has quit [Read error: Operation timed out]
<n06rin>
i need to write it. It doesn't exsist
<ggole>
We gave you working versions. Write and test the rest of the code, using them.
tianon has joined #ocaml
<ggole>
Then, if you need to, you can write a replacement.
<ggole>
It's very important to split things up into managable bits.
<n06rin>
repeat is work, but it's not a decision, because i need to make it without concat. Only what I need to use is ^ and simple statement of function. And I have no idea how to make it
<mrvn>
let rec repeat f acc = function 0 -> acc | n -> repeat f (f acc) (n-1);;
<mrvn>
let repeat_concat s n = repeat ((^) s) "" n;;
dsheets has quit [Ping timeout: 276 seconds]
tlockney has quit [Excess Flood]
tlockney has joined #ocaml
AltGr has quit [Quit: Konversation terminated!]
tianon has quit [Ping timeout: 245 seconds]
Kakadu has quit [Quit: Konversation terminated!]
tianon has joined #ocaml
alexey has quit [Remote host closed the connection]
alexey has joined #ocaml
n06rin has left #ocaml []
Neros has quit [Ping timeout: 245 seconds]
ollehar has quit [Ping timeout: 246 seconds]
osa1 has joined #ocaml
tianon has quit [Ping timeout: 264 seconds]
amirmc has quit [Ping timeout: 246 seconds]
<kerneis>
or even simpler, without the accumulator (because tail-recursion is confusing for beginners):
<mrvn>
kerneis: Nah, then he could just hand that in as answere
<kerneis>
let rec repeat f x n = if n = 0 then x else f (repeat f x (n-1))
<kerneis>
ah, sorry
<kerneis>
this is an exercise?
* kerneis
didn't read the full backlog
zpe_ has joined #ocaml
tianon has joined #ocaml
zpe has quit [Ping timeout: 264 seconds]
smondet` has joined #ocaml
smondet has quit [Remote host closed the connection]
demonimin has quit [Quit: No Ping reply in 180 seconds.]
demonimin has joined #ocaml
introom has quit [Remote host closed the connection]
<mrvn>
let repeat s n = let rec loop acc s = let s2 = s ^ s in function | 0 -> acc | n when n mod 2 = 0 -> loop acc s2 (n / 2) | n -> loop (acc ^ s) s2 (n / 2) in loop "" s n;;
<mrvn>
let repeat s n = let rec loop acc s = let s2 = s ^ s in function | 0 -> acc | n -> loop (if n mod 2 = 0 then acc else acc ^ s) s2 (n / 2) in loop "" s n;;
yacks has quit [Read error: Operation timed out]
skchrko has quit [Quit: Leaving]
ben_zen has joined #ocaml
watermind has joined #ocaml
tianon has quit [Ping timeout: 256 seconds]
tianon has joined #ocaml
ben_zen has quit [Ping timeout: 256 seconds]
<bernardofpc>
mrvn: a ^ b is O(1), O(len a) or O(len a + len b) ?
<mrvn>
the later
<bernardofpc>
oh
<mrvn>
Does plain linux run on te Dragonboard?
<mrvn>
ups
<bernardofpc>
is there a reason for itering over b ?
<mrvn>
bernardofpc: memcpy()
<bernardofpc>
an ocaml string is a C string then ?
<mrvn>
but I assume that has lots of binary drivers
<mrvn>
bernardofpc: no. an ocaml string is a block with a length and data
<mrvn>
^ creates a new block and copies both a and b into it
<companion_cube>
is prefixed by a block that indicates which kind of value it is (block) and its size
<bernardofpc>
righ, is not like a list
<bernardofpc>
(a list would be just O(len a), if b is immutable, because you follow cdr
<bernardofpc>
and in that case, either s ^ s or s ^ acc has the same complexity)
<kerneis>
correct
<mrvn>
ocamlfind: Package `cstruct' not found
<mrvn>
Anyone know what debian package that is in?
<ggole>
mrvn: hmm, that looks a bit like the fast exponentiation algorithm
<mrvn>
ggole: yes
<ggole>
let repeat str n = let len = String.length str in let s = String.create (len * n) in for i = 0 to n - 1 do String.blit str 0 s (i * len) len done; s
<ggole>
Ugly :/
<ggole>
But probably faster
Drup has quit [Ping timeout: 256 seconds]
zpe_ has quit [Remote host closed the connection]
Neros has joined #ocaml
<mrvn>
ggole: let repeat str = function | count when count <= 0 -> "" | 1 -> str | count -> let len = String.length str in let len2 = len * count in let s = String.create len2 in let rec loop n = if 2 * n >= len2 then String.blit s 0 s n (len2 - n) else begin String.blit s 0 s n n; loop (2 * n) end in String.blit str 0 s 0 len; loop len; s;;
zpe has joined #ocaml
mcclurmc has quit [Quit: Leaving.]
zpe has quit [Ping timeout: 264 seconds]
<ggole>
Manual strength reduction?
<mrvn>
How do I get myocamlbuild to install into debian/tmp instead of /? DESTDIR and PREFIX don't work.
Drup has joined #ocaml
ollehar has joined #ocaml
yacks has joined #ocaml
dsheets has joined #ocaml
ygrek has quit [Ping timeout: 264 seconds]
s4muel has joined #ocaml
mcclurmc has joined #ocaml
ben_zen has joined #ocaml
dsheets has quit [Read error: Connection reset by peer]
dsheets has joined #ocaml
ben_zen has quit [Ping timeout: 240 seconds]
<kerneis>
mrvn: I assume you mean ocamlfind rather that myocamlbuild, right?