<xevz>
I'm playing around with ocamllex and ocamlyacc and try to parse the Weechat log format, however, I can't get it to work with spaces in strings. Could someone give me a hint?
<Ori_B>
xevz: seems that a regex might be a better match for that sort of format?
<xevz>
Ori_B: Of course. I'm just playing around. :)
<xevz>
And not playing around as in "messing with you", but as in "I'm trying to learn, so I write useless/unnecessary complicated code". :)
<Ori_B>
mm; yeah. I don't see an especially obvious way of doing this cleanly, but I'm not an expert.
<Ori_B>
the problem is more or less that the "tokens" change as you move forward in the line, effectively
<Ori_B>
so you can't just lex in a straightforward manner.
<xevz>
There's some similar code in Practical OCaml, which works. But I guess that might be because there's a bit more to it in that example.
<xevz>
But It doesn't look like it.
<xevz>
it*
quelqun_dautre has quit [Ping timeout: 245 seconds]
quelqun_dautre has joined #ocaml
tmaeda is now known as tmaedaZ
ztfw has quit [Remote host closed the connection]
{newbie} has joined #ocaml
<{newbie}>
hi, can I call native code from ocaml that uses threads?
tmaedaZ is now known as tmaeda
sepp2k1 has quit [Quit: Leaving.]
{newbie} has quit [Quit: {newbie}]
tmaeda is now known as tmaedaZ
slash_ has quit [Quit: Lost terminal]
jao has joined #ocaml
_unK has quit [Remote host closed the connection]
bzzbzz has quit [Ping timeout: 268 seconds]
enthymene has quit [Quit: rcirc on GNU Emacs 23.1.1]
krankkatze has quit [Ping timeout: 248 seconds]
CcSsNET has joined #ocaml
Drk-Sd has joined #ocaml
maskd has quit [Quit: leaving]
travisbrady has quit [Quit: travisbrady]
bmp has joined #ocaml
bzzbzz has joined #ocaml
seanmcl has quit [Quit: seanmcl]
travisbrady has joined #ocaml
bzzbzz has quit [Quit: leaving]
enthymene has joined #ocaml
dark has quit [Remote host closed the connection]
valross has joined #ocaml
gmh33 has joined #ocaml
shr3kst3r has quit [Ping timeout: 240 seconds]
shr3kst3r has joined #ocaml
kaustuv has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
Drk-Sd has quit [Quit: {'EXIT', Drk-Sd, "bye"}]
eldragon has quit [Read error: Connection reset by peer]
bmp has quit [Quit: bmp]
bmp has joined #ocaml
eldragon has joined #ocaml
bmp has quit [Quit: bmp]
pad has quit [Remote host closed the connection]
seafood has joined #ocaml
seafood has quit [Client Quit]
ulfdoz has joined #ocaml
gmh33 has quit [Quit: Leaving]
seafood has joined #ocaml
travisbrady has quit [Quit: travisbrady]
Associat0r has joined #ocaml
albacker has joined #ocaml
seafood has quit [Quit: seafood]
joewilliams is now known as joewilliams_away
ttamttam has joined #ocaml
enthymene has quit [Quit: rcirc on GNU Emacs 23.1.1]
ttamttam has quit [Quit: Leaving.]
avsm has joined #ocaml
Yoric has joined #ocaml
valross has quit [Quit: Ex-Chat]
ulfdoz has quit [Ping timeout: 256 seconds]
smimou has quit [Ping timeout: 246 seconds]
smimou has joined #ocaml
Submarine has joined #ocaml
ttamttam has joined #ocaml
ygrek has joined #ocaml
Yoric has quit [Quit: Yoric]
_zack has joined #ocaml
avsm has quit [Quit: Leaving.]
Submarine has quit [Quit: Leaving]
<albacker>
if i'd like to do some swaping during my code in an list. since i can't normally do it. is it good if i transform the int list into int ref list and then use it and at the end reconvert it to int list?
<albacker>
int list -> int ref list -> do work/swapping of elements -> int list
<albacker>
or should i just use array-s?
<flux>
well, if yuo just need to some sequence of swapping, you could device an algorithm int list -> swapping instructions -> int list
<flux>
but perhaps arrays are more suitable. depends on your other needs I guess.
<albacker>
just messing around, having lots of free time i think..
<albacker>
flux, have you ever worked with pxp?
<flux>
no
<albacker>
ok :) thanks
filp has joined #ocaml
pimmhogeling has joined #ocaml
ikaros has joined #ocaml
Yoric has joined #ocaml
pimmhogeling has quit [Read error: Connection reset by peer]
pimmhogeling has joined #ocaml
_zack has quit [Quit: Leaving.]
yziquel has joined #ocaml
<yziquel>
hi. has anyone written a mail transfer agent in OCaml?
<Camarade_Tux>
I don't know if many people already had nacl installed on their machine ;-)
_zack has joined #ocaml
diml has quit [Ping timeout: 248 seconds]
diml has joined #ocaml
spearalot has joined #ocaml
<mfp>
Camarade_Tux: do you know which browsers are supported by NaCl? can't find it in NaCl's site
<Camarade_Tux>
mfp: I'd assume it's a regular npapi plugin (netscape plugin, like all browser plugins, which means it's a .dll or .so) so it doesn't need special support from the browser, only the platform
<mfp>
hmm NPAPI not implemented in recent IE
<Camarade_Tux>
yes, except IE but they have support for IE afaik
<Camarade_Tux>
hmmm, I think so...
<Camarade_Tux>
I'm seeing a lot of contradictory things, the project seem too young right now, doesn't look like it has been tested on enough platforms
<mfp>
Camarade_Tux: can you see my submission at http://www.reddit.com/r/programming/new/?sort=new ? I can't... seems I've fallen into a spam tarpit (why?? I've submitted 4 links in the last 6 months)
<Camarade_Tux>
mfp: no, I can't
<mfp>
guess some moderator hates me :-|
<Camarade_Tux>
well, the most recent links in proggit are definitely spam with scores of -4 and -5, if your submission isn't visible...
<Camarade_Tux>
I've seen bugs on reddit however, especially the linux subreddit being completely empty at some times
<Camarade_Tux>
should be worth reporting it as a bug
<Alpounet>
mrvn, I'm trying to get something from the samples given there
<mrvn>
I don't see any example there that correlates two types or extends one.
<mrvn>
[> 'a] should really be allowed.
<Alpounet>
for a precise case, like the one with `R and `W, you can write : [`R] -> [> `R] -> unit
<Alpounet>
but for any polymorphic variant...
<mrvn>
The specific case is trivial.
<mrvn>
I want to be able to store [`R | `W] string in a ([`R] string, [`R|`W]) container.
<Alpounet>
mrvn, what makes me think it is possible is this sample :
<Alpounet>
#let open_vlist l = (l : 'a vlist :> [> 'a vlist]);;
<Alpounet>
val open_vlist : 'a vlist -> [> 'a vlist ] = <fun>
<mrvn>
val set : ('a, [> `Write]) t -> 'a S.t -> unit
<Alpounet>
the [> 'a vlist] there.
<mrvn>
What is a vlist?
<Alpounet>
#type 'a vlist = [`Nil | `Cons of 'a * 'a vlist];;
<Alpounet>
but it doesn't matter
tmaedaZ is now known as tmaeda
<Alpounet>
a normal type, like 'a vlist, appears in [> ]
<mrvn>
Why doesn't that work for 'a itself too?
<Alpounet>
I really have *no* idea
<Alpounet>
oh
<Alpounet>
I think I know why
<Alpounet>
actually the declaration of vlist matters
<mrvn>
Error: The type 'a vlist is not a polymorphic variant type
<Alpounet>
it's because 'a vlist is defined in terms of polymorphic variants
<mrvn>
type 'a read = [ `R ]
<mrvn>
type 'a f = 'a read -> [> 'a read ] -> unit;;
<mrvn>
Error: A type variable is unbound in this type declaration.
<mrvn>
In type 'a read -> ([> 'a read ] as 'b) -> unit the variable 'b is unbound
<mrvn>
works so far.
<Alpounet>
oh yeah
<Alpounet>
read is one, here
<Alpounet>
so yeah it works
<mrvn>
type ('a, 'b) f = 'a read -> 'b -> unit constraint 'b = [> 'a read ]
<Alpounet>
does this work ?
<mrvn>
syntax wise it does. Now I need to figure out how to make the "'a read" to be general.
<mrvn>
The "[`R]" must become "[`R] perms" or something.
<mrvn>
module P = struct type 'a perms = 'a constrain 'a [< `Read | `Write | `Const ]
<mrvn>
ups
<mrvn>
module P : sig type 'a perms = 'a constraint 'a = [< `Const | `Read | `Write ] end
<mrvn>
... Error: The type [< `Const | `Read | `Write ] P.perms is not a polymorphic variant type
<mrvn>
Not a polymorphic variant type? What is it then?
* Alpounet
doesn't see what's wrong
yziquel has quit [Ping timeout: 252 seconds]
<mrvn>
The < is wrong
<orbitz>
[>
<orbitz>
i jus tmade tath up
<mrvn>
type 'a perms = 'a constraint 'a = [< `Read | `Write | `Const ]
<mrvn>
let set x y = (x : ([< 'a P.perms], [> `Write]) t) := (y : [> 'a P.perms] S.t)
<mrvn>
val set : ('a P.perms, [> `Write ]) t -> 'a P.perms S.t -> unit
<mrvn>
type 'a perms = [ `Read | `Write | `Const ] I mean
<mrvn>
Without < it looses the ability to have subsets
ttamttam has quit [*.net *.split]
gildor has quit [*.net *.split]
jonafan has quit [*.net *.split]
chicco has quit [*.net *.split]
ttamttam has joined #ocaml
gildor has joined #ocaml
jonafan has joined #ocaml
chicco has joined #ocaml
bzzbzz has joined #ocaml
ttamttam has quit [Quit: Leaving.]
quelqun_dautre has quit [Ping timeout: 245 seconds]
quelqun_dautre has joined #ocaml
<mrvn>
# type ('a, 'b) f = ([> 'b] as 'a) -> unit;; ^^
<mrvn>
Error: The type 'a is not a polymorphic variant type
<mrvn>
The 'b is underlined but it says 'a. WTF?
<Alpounet>
I think using "as 'a" whereas you already have an 'a in scope is wrong
<Alpounet>
you need to use constraint imo
<mrvn>
# type ('a, 'b) f = ([> 'b foo] as 'a) -> unit;;
<mrvn>
type ('a, 'b) f = 'a -> unit constraint 'a = [> 'b foo ]
<mrvn>
The "as 'a" is fine.
quelqun_dautre has quit [Ping timeout: 245 seconds]
quelqun_dautre has joined #ocaml
<Alpounet>
ok so the compiler probably needs to be sure that 'b will be defined in terms of pol. variants
<mrvn>
and it lacks a constraint syntax for that.
<mrvn>
But we had that above. I was just wondering about it saying 'a instead of 'b
<Alpounet>
ok
<mrvn>
Today is going to be a non-progress day. I'm like 50% finished with my app and now I notice that some modules have a bad interface. Lots of rewriting to do
seafood has joined #ocaml
quelqun_dautre has quit [Ping timeout: 245 seconds]
<orbitz>
that's progress in my book
<orbitz>
I've rewritten major peices of the app i'm on like 3 times so far
<orbitz>
and am predicting at least another rewrite
tmaeda is now known as tmaedaZ
quelqun_dautre has joined #ocaml
seafood has quit [Quit: seafood]
<xevz>
Looks like more people are awake now. :D
<xevz>
I'm trying to write a parser for the Weechat log format, but I can't get it to accept strings which contain space.
<xevz>
I know regexp would be better suited for this, but then I won't learn anything new. :P
<xevz>
Some help/hints would be appreciated. :)
spearalot has joined #ocaml
albacker has quit [Quit: Leaving]
sepp2k has joined #ocaml
spearalot has quit [Quit: Computer has gone to sleep]
albacker has joined #ocaml
bmp has joined #ocaml
quelqun_dautre has quit [Ping timeout: 245 seconds]
quelqun_dautre has joined #ocaml
joewilliams_away is now known as joewilliams
quelqun_dautre has quit [Ping timeout: 245 seconds]
_zack has quit [Quit: Leaving.]
quelqun_dautre has joined #ocaml
travisbrady has joined #ocaml
krankkatze has joined #ocaml
bmp has quit [Quit: bmp]
quelqun_dautre has quit [Ping timeout: 245 seconds]
sepp2k has quit [Read error: Connection reset by peer]
krankkatze has quit [Remote host closed the connection]
det has quit [Read error: Connection reset by peer]
krankkatze has joined #ocaml
f[x] has quit [Ping timeout: 268 seconds]
quelqun_dautre has joined #ocaml
sepp2k has joined #ocaml
filp has quit [Quit: Bye]
_zack has joined #ocaml
<Camarade_Tux>
mfp: re-reddit and the groups.google.com block: "OK. that's a bit strange. We'll check it out and see what is going on. thanks, erik" (two hours ago)
<mfp>
they've unblocked it
<mfp>
(I rm'ed the groups.google.com submission when it showed in /new)
<Camarade_Tux>
oh, good :-)
<Camarade_Tux>
I spent the last three hours or so making nouveau (the driver for nvidia cards) work on my laptop and spent that time without graphical browser, had to update and recompile several packages but got it to work :-)
Yoric_ has joined #ocaml
Yoric has quit [Ping timeout: 252 seconds]
Yoric_ is now known as Yoric
Yoric has quit [Remote host closed the connection]
Yoric has joined #ocaml
<_zack>
thelema: which is the current bug tracker for batteries? the homepage says that it is not the one on the forge, but does not say which is the right one :-)
ikaros has quit [Quit: Leave the magic to Houdini]
yakischloba has quit [Quit: Leaving.]
yakischloba has joined #ocaml
_zack has quit [Quit: Leaving.]
yakischloba has quit [Ping timeout: 264 seconds]
albacker has quit [Ping timeout: 252 seconds]
ikaros has joined #ocaml
albacker has joined #ocaml
derdon has joined #ocaml
pad has joined #ocaml
ikaros has quit [Quit: Leave the magic to Houdini]
yakischloba has joined #ocaml
Anarchos has joined #ocaml
yakischloba1 has joined #ocaml
yakischloba has quit [Ping timeout: 256 seconds]
_andre has quit [Quit: *puff*]
bmp has joined #ocaml
ygrek has quit [Ping timeout: 245 seconds]
yakischloba1 has quit [Quit: Leaving.]
joewilliams is now known as joewilliams_away
slash_ has joined #ocaml
enthymene has joined #ocaml
Yoric has joined #ocaml
enthymene has quit [Quit: rcirc on GNU Emacs 23.1.1]
matthieu has joined #ocaml
_zack has joined #ocaml
sepp2k1 has joined #ocaml
sepp2k has quit [Ping timeout: 256 seconds]
CcSsNET has quit [Remote host closed the connection]
CcSsNET has joined #ocaml
yakischloba has joined #ocaml
joewilliams_away is now known as joewilliams
gareth_0 has joined #ocaml
gareth_0 has left #ocaml []
_zack has quit [Quit: Leaving.]
Yoric has quit [Quit: Yoric]
<mrvn>
Something is wrong with the dependency tracking in OCamlMakefile.
<mrvn>
File "entry.ml", line 1, characters 0-1:
<mrvn>
Error: The files data_entry.cmi and entry.cmi make inconsistent assumptions over interface Stripe
<mrvn>
% cat ._d/data_entry.d
<mrvn>
data_entry.cmo: stripe.cmi
<mrvn>
data_entry.cmx: stripe.cmx
<mrvn>
Shouldn't that also contain a line: data_entry.cmi: stripe.cmi?
<mrvn>
data_entry has no mli but stripe does. Looks like that is the trigger.
pimmhogeling has quit [Ping timeout: 264 seconds]
<mrvn>
Does one of the ocaml build systems put the compiled files in a subdir?
<mrvn>
by default
<Camarade_Tux>
ocamlbuild puts them in _build/
<mrvn>
Isn't that the one where you have to write code to put everything together?
<Camarade_Tux>
I copy the same myocamlbuild.ml each time to enable ocamlfind support if that's what you mean
<Camarade_Tux>
there's also the _tags file where you basically say what external libraries you need
<Camarade_Tux>
hugh, brain needz serious sl33p
kriko has joined #ocaml
* mrvn
needs a HowTo for it then
<kriko>
any up-to-date eclipse plugins for ocaml?
mjonsson has quit [Ping timeout: 240 seconds]
yakischloba has quit [Quit: Leaving.]
<Camarade_Tux>
I see mentions of eclipse quite often but I don't keep track of them unfortunately =/
<Camarade_Tux>
mrvn: can't remember how I started with it
<Camarade_Tux>
I see some recent mentions of "ocalide" but couldn't find a link
<Camarade_Tux>
mrvn: just as an example, here's the _tags for one of my projects: http://git.ocamlcore.org/cgi-bin/gitweb.cgi?p=yypkg/yypkg.git;a=blob;f=src/_tags;h=d2db49ee773389b827c4053e20b06be0fd438f36;hb=HEAD
<mrvn>
WTF?
<Camarade_Tux>
hmmmm?
<mrvn>
Who thought up that syntax?
smimou has quit [Ping timeout: 246 seconds]
<Camarade_Tux>
this _tags file works, it doesn't mean it's pretty nor properly written
smimou has joined #ocaml
smimou has quit [Changing host]
smimou has joined #ocaml
<Camarade_Tux>
I have to say I often do it with trials and errors
<mrvn>
And I compile by running ocamlrun myocamlbuld.ml?
<kriko>
Camarade_Tux: I found one, seems basic but should work