wagle has quit [Remote host closed the connection]
pootler_ has quit [Quit: leaving]
pootler_ has joined #ocaml
mattrepl has joined #ocaml
shinnya has joined #ocaml
ollehar1 has joined #ocaml
wagle has joined #ocaml
ollehar has quit [Ping timeout: 248 seconds]
Yoric has quit [Ping timeout: 264 seconds]
ollehar has joined #ocaml
Yoric has joined #ocaml
<ontologiae>
hi
<ontologiae>
I have a function which has type in_channel -> out_channel -> unit
<companion_cube>
hello
<ontologiae>
and I would like to rewrite in to : string -> string -> unit
<ontologiae>
what is the simplest way to do that
<ontologiae>
string ie. to take a string instead a file and put the ouput in a string
<ontologiae>
?
<flux>
the type would be string -> string. but you cannot use the standard channel stuff for that as they lack interoperability with strings. for example Batteries comes with its own channels that support string channels as well
<flux>
(should be pretty much plug'n play)
Cypi_ is now known as Cypi
smondet has joined #ocaml
<ontologiae>
thx flux
djcoin has quit [Ping timeout: 260 seconds]
rwmjones has quit [Ping timeout: 240 seconds]
ttamttam has quit [Quit: ttamttam]
ttamttam has joined #ocaml
rwmjones has joined #ocaml
Netfeed has left #ocaml []
wagle has quit [Remote host closed the connection]
wagle has joined #ocaml
wagle has quit [Ping timeout: 260 seconds]
wagle has joined #ocaml
chambart has joined #ocaml
fayden has quit [Read error: Operation timed out]
chambart__ has joined #ocaml
chambart has quit [Ping timeout: 276 seconds]
raichoo has quit [Quit: leaving]
<gasche>
ontologiae: for the output you want Buffer rather than String
mika2 has quit [Quit: Leaving.]
<gasche>
avsm: it doesn't bind any openCV function, though
<gasche>
(it's using Swig; another choice I hadn't considered)
hkBst has quit [Quit: Konversation terminated!]
pootler_ has quit [Quit: Lost terminal]
venk has quit [Ping timeout: 246 seconds]
mfp_ has quit [Read error: Connection reset by peer]
pootler_ has joined #ocaml
pootler__ has joined #ocaml
pootler__ has quit [Client Quit]
pootler_ has quit [Client Quit]
pootler_ has joined #ocaml
pootler__ has joined #ocaml
talzeus has quit [Remote host closed the connection]
venk has joined #ocaml
chambart__ has quit [Ping timeout: 276 seconds]
mcclurmc has quit [Ping timeout: 256 seconds]
mfp_ has joined #ocaml
csakatoku has joined #ocaml
mfp_ is now known as mfp
shinnya has quit [Ping timeout: 260 seconds]
bkpt has joined #ocaml
raichoo has joined #ocaml
raichoo has quit [Quit: leaving]
ttamttam has quit [Quit: ttamttam]
ttamttam has joined #ocaml
ollehar has quit [Ping timeout: 246 seconds]
ttamttam has quit [Client Quit]
tane has joined #ocaml
csakatoku has quit [Remote host closed the connection]
tobiasBora has joined #ocaml
djcoin has joined #ocaml
rwmjones has quit [Read error: Operation timed out]
raichoo has joined #ocaml
ontologiae has quit [Ping timeout: 260 seconds]
spanish has joined #ocaml
ollehar has joined #ocaml
beckerb has quit [Ping timeout: 240 seconds]
<spanish>
if I need mtasc's lexer/parser to store two unsigned ints for each file it processes what would be the best option? I need to kee track of how many preprocessor directives the file had, and what the last line number it is, as per cpp
<spanish>
so that I can compute offsets and hence, actual line number within the file seen on the editor
skchrko has quit [Quit: Leaving]
travisbrady has joined #ocaml
rwmjones has joined #ocaml
<ggole>
Pass an argument in which you record that information?
darkf has quit [Quit: Leaving]
csakatoku has joined #ocaml
<spanish>
wouldn't I need a hash table or something? I need to access those two fields in the case of error or warning, for the specified file
<ggole>
A hash table might work, yeah
<ggole>
It's your problem: what would fit the bill? You can just pass whatever you like to the lexer to be populated.
<spanish>
well the problem in that case is how would you store that for each file, in a retrievable way
<ggole>
A table mapping file name to a record of that info seems reasonable
<spanish>
thanks, gonna read on tables and see
<ggole>
That doesn't really affect the lexer though
<ggole>
I mean, the lexer can just count preprocessor defs and line numbers, and needs know nothing about how you wish to record that info.
<spanish>
yes, that's what Iḿ doing, counting them up on the lexer
<ggole>
Ah, right, for some reason I thought you were having trouble with the lexer interface
<spanish>
no, that's done, the problem is
pootler_ has quit [Ping timeout: 252 seconds]
pootler__ has quit [Ping timeout: 246 seconds]
<ggole>
You want to record information per file, right
<ggole>
So a hash table or map.
<spanish>
it first parses everything, and then on a module called typer, it complains about errors
<spanish>
ok, thanks
<spanish>
actually I'd say it interperses lexing and parsing for different files, but I'm still trying to make sense of this so I might be wrong
csakatoku has quit [Ping timeout: 260 seconds]
ollehar1 has quit [Read error: Operation timed out]
toolslive has joined #ocaml
skchrko has joined #ocaml
tane has quit [Read error: Connection reset by peer]
tani has joined #ocaml
dezzy_ has joined #ocaml
alang has quit [Read error: Operation timed out]
dezzy has quit [Read error: Connection reset by peer]
alang has joined #ocaml
pootler_ has joined #ocaml
Drup has quit [Ping timeout: 256 seconds]
pootler__ has joined #ocaml
Kakadu has joined #ocaml
yacks has quit [Read error: Connection reset by peer]
gautamc has quit [Read error: Connection reset by peer]
SanderM has joined #ocaml
gautamc has joined #ocaml
csakatoku has joined #ocaml
Drup has joined #ocaml
yacks has joined #ocaml
contempt has quit [Ping timeout: 248 seconds]
csakatoku has quit [Ping timeout: 264 seconds]
tani has quit [Quit: Verlassend]
contempt has joined #ocaml
tobiasBora has quit [Read error: No route to host]
tobiasBora has joined #ocaml
mcclurmc has joined #ocaml
ttamttam has joined #ocaml
tobiasBora has quit [Ping timeout: 260 seconds]
tobiasBora has joined #ocaml
tane has joined #ocaml
ggole has quit []
djcoin has quit [Quit: WeeChat 0.4.0]
ttamttam has quit [Quit: ttamttam]
pootler_ has quit [Ping timeout: 240 seconds]
pootler__ has quit [Ping timeout: 260 seconds]
Kakadu has quit [Ping timeout: 246 seconds]
csakatoku has joined #ocaml
ygrek has joined #ocaml
SanderM has quit [Remote host closed the connection]
csakatoku has quit [Ping timeout: 252 seconds]
<spanish>
if I have a type like this: type algo { file : string; pmin : int; }, how would I declare such a variable?
<spanish>
I'm trying like `let somehting = ({ "filename", 10 } : Module_name.algo)' but the compiler doesn't like it
<Drup>
spanish: My intention is not to be rude, but sometimes, the manual is indeed the solution to your problem :)
<spanish>
sure, I'm looking at that very page, but I think it's because I'm using an expression instead of a plain int, it doesn't like it
<spanish>
I always get operator expected, perhaps the problem is such expression is not really returning an int
<toolslive>
type algo = {file:string;pmin:int}
rly has joined #ocaml
<toolslive>
let bla = {file="xxxx";pmin=10}
<rly>
This depends on extlib, does batteries provide something similar? Std.input_list chan
<toolslive>
gives val bla : algo = {file = "xxxx"; pmin = 10}
<toolslive>
works perfectly
<rly>
In Haskell I can just write readLines "file" and I get a list of lines; simple and straight forward. How can I do the same in OCaml?
<toolslive>
it's not a good idea to do that ... OCaml isn't lazy
<toolslive>
but pervasives provides input_line : in_channel -> string
<toolslive>
so building it requires a simple loop ...
<spanish>
and is it possible to know current line number from within a rule in the lexer?
ygrek has quit [Ping timeout: 264 seconds]
<toolslive>
yes it is.
<spanish>
the problem above was that I wasn't doing pmin=10, but isntead pmin = (expr), but I corrected that already
<spanish>
how? hehe
<toolslive>
take a look at Lexing.lexbuf
<spanish>
thanks, let me see
ontologiae has joined #ocaml
<toolslive>
@rly from the top of my head:
<toolslive>
let read_lines n =
<toolslive>
let ic = open_in n in
<toolslive>
let rec loop acc =
<toolslive>
try
<toolslive>
let line = input_line ic in
<toolslive>
loop (line :: acc)
<toolslive>
with
<toolslive>
End_of_file -> List.rev acc
<toolslive>
in
<toolslive>
loop []
<toolslive>
although some library somewhere might provide that for you....
structuralist has joined #ocaml
speredenn has joined #ocaml
emmanuelux has joined #ocaml
ygrek has joined #ocaml
ontologiae has quit [Ping timeout: 260 seconds]
eikke has quit [Ping timeout: 264 seconds]
<rgrinberg>
batteries provides this
<rgrinberg>
so does core
dezzy_ is now known as dezzy
dezzy has quit [Changing host]
dezzy has joined #ocaml
dsheets has quit [Ping timeout: 276 seconds]
ygrek has quit [Ping timeout: 276 seconds]
_andre has quit [Quit: leaving]
dsheets has joined #ocaml
eikke has joined #ocaml
chambart__ has joined #ocaml
<rly>
I got that part to work, but now it cannot find my utilities library.
<rly>
It says that it is installed, but ocamlfind list cannot find it.
raichoo has quit [Quit: leaving]
Snark has quit [Ping timeout: 245 seconds]
<rly>
is not a compiled interface for this version of OCaml. It seems to be for an older version ...
<rly>
Versioned interfaces probably were too much work?
transfinite has quit [Remote host closed the connection]
<adrien>
gasche: btw, cross-compilation support for 4.02.0 is definitely impossible and has not been something I actually considered; however, having several of the patches integrated so that the number of patches needed to build a cross-compiler is lower was and still is a goal
transfinite has joined #ocaml
osnr has quit [Quit: Leaving.]
osnr has joined #ocaml
osnr has quit [Changing host]
osnr has joined #ocaml
<rly>
How can I make sure that I won't ever get that error message ever again?
<rly>
I thought that using a build system like oasis would solve this problem, but it apparently doesn't rebuild even when there is another compiler on $PATH.
<rly>
I haven't verified that, but that seems rather bad.
eikke has quit [Ping timeout: 252 seconds]
spanish has quit [Quit: Leaving]
<orbitz>
what issue are you ahving rly ?
<rly>
orbitz: currently a different one, I just want to do let a=f<newline>let b=g<newline>command_a; command_b; command_c
ollehar1 has joined #ocaml
eikke has joined #ocaml
<orbitz>
rly: i'm not sure what you're asking...
emmanuelux has quit [Read error: Operation timed out]
<rly>
orbitz: bind some variables, execute some commands, that's all I wanbt.
<rly>
orbitz: want
<rly>
orbitz: but that syntax is wrong.
<orbitz>
in what context is this?
<orbitz>
if what you just said isin a file, then you need a bunch of ;;'s
<orbitz>
or a let () = ... nad a few 'in's
speredenn has quit [Quit: Leaving]
<rly>
orbitz: like this? let a=1;;let b=2;;print_int (a +b);print_int a
<orbitz>
another ;;, but sure
<rly>
orbitz: I already made it work with in, but this is just for reference.
<rly>
orbitz: instead of ; you mean? or after the last a?
<orbitz>
all ; need to be ;; in this case
<orbitz>
like on the repl
csakatoku has joined #ocaml
<rly>
orbitz: and how can I redirect all the output from a process I called to stdout?
csakatoku has quit [Ping timeout: 260 seconds]
malo has joined #ocaml
Yoric has quit [Ping timeout: 248 seconds]
malo_ has joined #ocaml
toolslive has quit [Quit: Leaving]
nlucaroni has joined #ocaml
nlucaroni has quit [Client Quit]
malo has quit [Ping timeout: 264 seconds]
nlucaroni has joined #ocaml
rwmjones has quit [Read error: Operation timed out]
valatar has joined #ocaml
malo_ has quit [Ping timeout: 252 seconds]
malo has joined #ocaml
valatar has quit [Ping timeout: 252 seconds]
talzeus has joined #ocaml
eikke has quit [Ping timeout: 252 seconds]
smondet has quit [Quit: leaving]
rwmjones has joined #ocaml
malo_ has joined #ocaml
<orbitz>
rly: i don't understand your question
malo has quit [Ping timeout: 268 seconds]
valatar has joined #ocaml
malo has joined #ocaml
malo_ has quit [Ping timeout: 252 seconds]
valatar has quit [Ping timeout: 276 seconds]
<amiller_>
is there anything like a guide for type-conv
<amiller_>
i'm trying to write a project type-directed language extension and so type-conv seems like it would be preferable to camlp4/5