brendan has quit [Remote host closed the connection]
brendan has joined #ocaml
everyonemines has quit [Quit: Leaving.]
Cyanure has joined #ocaml
Cyanure has quit [Remote host closed the connection]
surikator has joined #ocaml
edwin has joined #ocaml
ztfw has joined #ocaml
mmu_man has joined #ocaml
maufred has quit [Quit: leaving]
rgrinberg has quit [Ping timeout: 260 seconds]
avsm has joined #ocaml
maufred has joined #ocaml
superbobry has joined #ocaml
avsm has quit [Quit: Leaving.]
Kakadu has joined #ocaml
Sysop_fb has quit [Ping timeout: 256 seconds]
superbobry has left #ocaml []
avsm has joined #ocaml
ikaros has joined #ocaml
thelema has quit [Read error: Connection reset by peer]
thelema has joined #ocaml
destrius has quit [Quit: Leaving.]
emmanuelux has joined #ocaml
arubin has quit [Quit: arubin]
sepp2k has joined #ocaml
ais523 has joined #ocaml
<ais523>
how do I convert a char to a string in OCaml, without using any modules? I'm trying to write a script to automatically mark other people's homework (in a kind of reverse to the usual question), so it has to run inside a sandbox where modules aren't allowed, and there's no standard string_of_char function, nor anything similar that I can find in Pervasives
<ais523>
I have a feeling that I'm missing some sort of syntax for declaring a string a character at a time
<bnwr>
ais523: let string_of_char = String.make 1
<ais523>
hmm, is that the only way? ouch
<ais523>
the problem is that I can't use String from inside my sandbox, so I was hoping there's another way
<bnwr>
or, let string_of_char c = let s = String.create 1 in s.[0] <- c
<ais523>
ah right; and I can get a string like that using a string literal
<ais523>
let me try that
<adrien>
or you create the string first (if it's more than 1 char) and fill it progressively
<bnwr>
or, Printf.sprintf "%c" c
<ais523>
Error: Unbound value x
<ais523>
# let x = "x" in x.[0] <- 'y'; x ;;
<ais523>
- : string = "y"
<ais523>
err, without the first line
<ais523>
yay, that does it
<adrien>
watch out however
<bnwr>
there is some weird behavior with this
<adrien>
let foo () = "x"
<bnwr>
(prbly the same thing as adrien is going to tell)
<adrien>
doesn't allocate a new string at each call
<ais523>
indeed, I just noticed that
<ais523>
I feared it'd be something like that, so I had to go test it
<adrien>
so: let s1 = foo () in s1.[0] <- "a"; let s2 = foo () in print_endline s2
<adrien>
will print "a"
<ais523>
yes
<adrien>
the String module has a bunch of things; why can't you use it?
<ais523>
basically, because I'm marking code, and the students aren't allowed to use modules other than List and Pervasives
<ais523>
so I modified the OCaml interpreter to reject use of any other modules
<ais523>
now, that means I can't use them myself, either, unfortunately
<adrien>
why do you have to run in exactly the same env? =/
<ais523>
because my code links to theirs
<ais523>
I suppose I could compile it separately, but that would be quite some setup
<ais523>
let string_of_char c = let x = "*" ^ "" in x.[0] <- c ; x ;;
<ais523>
OK, I think /that/ works; the concatenation operator makes a new string
<adrien>
for some things, the Obj module could work (it could be added to the env without anyone else using it I guess) but it's probably easier to pull some modules in your code
<ais523>
thanks everyone who helped, I think I have a working solution now
<ais523>
hacky though it is
ais523 has left #ocaml []
<flux>
kakadu, have you been progressing with the Qt bindings?
<Kakadu>
flux: yep, but firstly I shoul finish legacy gui tools
<flux>
ok. great to hear you are still working on it :-)
<Kakadu>
T_T too many free time for lablqt last days...
<adrien>
Kakadu: btw, some issues I had with the dependencies of lablqt were probaly my fault since I was running on a branch of godi that wasn't kept up-to-date
<adrien>
with the "right" one, it seems much much much better
emmanuelux has quit [Ping timeout: 240 seconds]
<adrien>
you need to make the number of concurrent CXX processes configurable however
<Kakadu>
adrien: Now I can caonfigure XML api to remove some classes
<Kakadu>
if u want to save some time or test compilation time with .opt and without)
<adrien>
I've edited the Makefile ;-)
<adrien>
checking how much it saves currently
<adrien>
2 minutes is still quite long
<adrien>
Kakadu: it looks like you could have some inheriting
<Kakadu>
But It is not real inheriting
<adrien>
also, it's probably slow only because of some optimization
<adrien>
because ocamlc.opt is 10 times faster than ocamlopt.opt
<Kakadu>
byte-code is generated many times faster
<adrien>
also, do you really need the type annotations in the generated file,
<adrien>
s/,/?/
<flux>
I haven't used it, but isn't that nice?
<flux>
at least when it doesn't work :)
<adrien>
what nice?
<adrien>
ah
<adrien>
I mean, I'm wondering if it could not make the compilation somehow slow
<adrien>
er
<Kakadu>
sometimes I need them, but with type-annotations I can check code correctness faster
<adrien>
so have a way to easily disable them
<adrien>
because of things like: method setAlignment (x0: [`AlignCenter | `AlignVertical_Mask | `AlignVCenter | `AlignBottom | `AlignTop | `AlignHorizontal_Mask | `AlignAbsolute | `AlignJustify | `AlignHCenter | `AlignRight | `AlignLeft]) = qLayout_setAlignment' me x0
<flux>
I doubt they would noticeably slow down compiling..
<adrien>
quite long and repeated several times
<adrien>
also, are you using recursion between classes?
<adrien>
if not, you could have a file for each class
<adrien>
could "class foo = object ... end and bar = object ... end and baz = object ........." make things slower than necessary?
<adrien>
(the "and" all the time)
<Kakadu>
adrien: Recursion presents. It is the reason why I have switched from modules to classes
<adrien>
hmpf
<adrien>
had the same issue
<adrien>
I've blacklisted a few values in lablwebkit because of that but it's annoying
<adrien>
(only have one or two issues)
<Kakadu>
flux: do u really think that manual type-annotations can seriously slow compilation process? it is absolutly unobvious for me
<Kakadu>
adrien: How did u translated classes like QSize, QRect, from C++ to OCaml?
<adrien>
no, he said he didn't think so ;-)
<adrien>
as far as I'm concerned, it's not so much the manual annotations that declaring a type for polymorphic variants several times
<Kakadu>
adrien: ))) doubt != think, )
<Kakadu>
flux: sorry
<adrien>
Kakadu: lablwebkit, for gtk ;-)
<Kakadu>
adrien: ok
<adrien>
hard to say so far but lablgtk has a method #connect which contains all the connectors for signals; maybe you could do something similar, it looks like you have some redundancy here
<adrien>
or rather that you have too many small objects
<Kakadu>
I know how to reduce `connect`'s signature twice, but it has low priority now
oriba has joined #ocaml
Anarchos has joined #ocaml
chambart has quit [Ping timeout: 245 seconds]
sgnb has quit [Read error: Connection reset by peer]
sgnb has joined #ocaml
Kakadu has quit [Quit: Page closed]
Kakadu has joined #ocaml
Boscop has joined #ocaml
avsm has quit [Ping timeout: 245 seconds]
joewilliams_away is now known as joewilliams
Kakadu has quit [Quit: Page closed]
_andre has joined #ocaml
joewilliams is now known as joewilliams_away
Snark has joined #ocaml
emmanuelux has joined #ocaml
Sysop_fb has joined #ocaml
_andre has quit [Quit: leaving]
_andre has joined #ocaml
_andre has quit [Client Quit]
_andre has joined #ocaml
chambart has joined #ocaml
joewilliams_away is now known as joewilliams
gmcabrita has joined #ocaml
Cyanure has joined #ocaml
ulfdoz has joined #ocaml
ttamttam has quit [Quit: Leaving.]
sepp2k has joined #ocaml
ttblrs has quit [Quit: ...]
fraggle_laptop has joined #ocaml
joewilliams is now known as joewilliams_away
maufred has quit [Quit: leaving]
hto has quit [Quit: Lost terminal]
hto has joined #ocaml
larhat has quit [Quit: Leaving.]
gmcabrita has quit [Max SendQ exceeded]
gmcabrita has joined #ocaml
fschwidom has joined #ocaml
ttamttam has joined #ocaml
ttamttam has quit [Client Quit]
clog has joined #ocaml
Anarchos has quit [Ping timeout: 258 seconds]
d159aniel has joined #ocaml
joewilliams is now known as joewilliams_away
sepp2k has quit [Ping timeout: 240 seconds]
thelema has quit [Remote host closed the connection]
Anarchos has joined #ocaml
Anarchos has quit [Quit: Vision[0.9.7-H-090423]: i've been blurred!]
Anarchos has joined #ocaml
sepp2k has joined #ocaml
ygrek has joined #ocaml
_andre has quit [Quit: leaving]
arubin has joined #ocaml
fraggle_laptop has quit [Quit: Quitte]
d159aniel has quit [Quit: Lost terminal]
<adrien>
where's the odb quickstart for users? and can it be used to create packages for a linux distribution? and does it have a lablgtk2 package?
ygrek has quit [Remote host closed the connection]
dsheets has joined #ocaml
ygrek has joined #ocaml
edwin has quit [Remote host closed the connection]
mmu_man has joined #ocaml
mmu_man is now known as mmu_BG
ygrek has quit [Ping timeout: 248 seconds]
sepp2k has quit [Remote host closed the connection]
dnolen has joined #ocaml
jamii has quit [Quit: Leaving]
randori has joined #ocaml
Amorphous has quit [Ping timeout: 240 seconds]
Anarchos has quit [Quit: Vision[0.9.7-H-090423]: i've been blurred!]