bradytrix has quit [Remote host closed the connection]
teknozulu has joined #ocaml
ygrek has joined #ocaml
tac_ has quit [Quit: Leaving]
aletheap_ has joined #ocaml
aletheap has quit [Ping timeout: 240 seconds]
aletheap_ is now known as aletheap
ygrek has quit [Ping timeout: 258 seconds]
koderok has joined #ocaml
manud has joined #ocaml
yotam has joined #ocaml
aletheap has quit [Ping timeout: 245 seconds]
Lasher` has joined #ocaml
manud has quit [Client Quit]
samrat has joined #ocaml
samrat has quit [Ping timeout: 260 seconds]
samrat has joined #ocaml
samrat has quit [Ping timeout: 258 seconds]
samrat has joined #ocaml
tnguyen has joined #ocaml
boogie has joined #ocaml
bytbox has quit [Remote host closed the connection]
bytbox has joined #ocaml
samrat has quit [Ping timeout: 255 seconds]
<teknozulu>
So I'm trying to construct a bst, but there is a problem. I've defined the left/right of a node as node option, but I don't know how to define the record itself as an option: http://pastebin.com/vnvSS3zf . I believe this is the cause of "This expression has type treenode option
<teknozulu>
but an expression was expected of type treenode" for lines 18 and 25?
<teknozulu>
ahh, fixed it (Some root)
samrat has joined #ocaml
koderok has quit [Quit: koderok]
samrat has quit [Ping timeout: 272 seconds]
samrat has joined #ocaml
samrat has quit [Ping timeout: 246 seconds]
q66[lap] has quit [Read error: Connection reset by peer]
samrat has quit [Quit: Computer has gone to sleep.]
<adrien>
as for why I cannot open in write mode: it's the executable I'm currently executing
<adrien>
at that point I might as well rewrite in C
<adrien>
gasche: hmmm, I hadn't thought of these primitives; performance isn't a concern (only one to read), however I think I'm staying with compatibility to 3.12 for now
Submarine has quit [Remote host closed the connection]
samrat has quit [Ping timeout: 250 seconds]
ontologiae has joined #ocaml
sheijk has joined #ocaml
sheijk has quit [Ping timeout: 245 seconds]
ygrek has joined #ocaml
samrat has joined #ocaml
taion809 has joined #ocaml
<adrien>
anyone remember what is the "proxy" field inside "struct caml_ba_array"?
<adrien>
and when it is NULL?
<whitequark>
def`: sublime-text-merlin is broken :/
<whitequark>
AttributeError: 'MerlinProcess' object has no attribute 'acquire'
<whitequark>
hm, this is very odd
<whitequark>
def`: nevermind, sublime barfed while reloading plugin
jgjl has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Anarchos has joined #ocaml
Simn has quit [Ping timeout: 260 seconds]
jgjl has joined #ocaml
isBEKaml has joined #ocaml
Simn has joined #ocaml
isBEKaml has quit [Quit: leaving]
<adrien>
hmpf, my complaint above was not baseless but wasn't the cause of my troubles
<adrien>
PROT_WRITE is fine as long as MAP_PRIVATE is also provided
<adrien>
my additional bindings in ocaml-archive to read from bigarrays were not good and were dereferencing a NULL
<adrien>
(twice, just-in-case)
isBEKaml has joined #ocaml
divyanshu has quit [Quit: Connection closed for inactivity]
samrat has quit [Ping timeout: 245 seconds]
sheijk has joined #ocaml
samrat has joined #ocaml
pminten has joined #ocaml
samrat has quit [Quit: Computer has gone to sleep.]
ysz has joined #ocaml
ysz has quit [Client Quit]
samrat has joined #ocaml
zpe has joined #ocaml
sheijk has quit [Ping timeout: 258 seconds]
xavierm02 has joined #ocaml
nicoo has joined #ocaml
<xavierm02>
Is it possible to define lazy operators like && without expanding them? I get that it's just an if-then-else but if I try to recreate it with a function, it evaluates both arguments before calling it so it can't be lazy...
<xavierm02>
I'd have exapected something like that to avoid evaluating the second argument (but it doesn't): let f x = if x then (fun y -> y) else (fun _ -> false);;
<xavierm02>
My use case for this is that I have a Yes/No/Maybe type and want to have binary operators on it. Thank you in advance for your answers.
<whitequark>
xavierm02: no, it's special-cased in the compiler
<nicoo>
adrien: Ah, ok, you xz. Then yes, you might run in the same issues as UPX
<nicoo>
I would say, though, that it is useful enough to be released on its own
<adrien>
it's a program + payload
tac_ has joined #ocaml
<jgjl>
Hi, is there an up-to-date HTTP proxy implementation for ocaml?
cody__ has joined #ocaml
<whitequark>
I don't think so
<whitequark>
nicoo: I don't think a regular self-extracting archive will get automatically flagged
<whitequark>
I mean, that's basically every installer ever
<nicoo>
whitequark: There have been cases of self-extracting installers that got flag because they were uncommon enough, and used by some “bad software”
<nicoo>
The antivirii compagnies usually don't care much about collateral damage
fraggle_ has quit [Read error: Connection reset by peer]
oscar_toro has quit [Ping timeout: 260 seconds]
cago has left #ocaml [#ocaml]
AlexRussia has joined #ocaml
<AlexRussia>
hello folks.I'm start to learn ocaml, but i see, interactive ocaml have one problem: i can't move to the left or to the right by current string.does ocalm have any alternative?
<AlexRussia>
ocaml*
MercurialAlchemi has quit [Ping timeout: 272 seconds]
<dmbaturin>
AlexRussia: Install utop.
teknozulu has joined #ocaml
<dmbaturin>
Opam is the easiest way to do it.
Arsenik has quit [Remote host closed the connection]
<companion_cube>
whitequark: do you know how to link statically with C libraries?
<companion_cube>
I'm struggling with my bindings...
<AlexRussia>
dmbaturin: i mean, compile ocaml from source code enough fast
<AlexRussia>
dmbaturin: than....even rust :/
<whitequark>
companion_cube: for bytecode, you can't. and for native code, I think you can just pass it on the ocamlopt invocation
<companion_cube>
oh.
<whitequark>
AlexRussia: Rust compiler is very, very, very slow.
<dmbaturin>
AlexRussia: Ocaml is written in ocaml.
<companion_cube>
so, for bytecode, can I still load the library in the toplevel?
<whitequark>
yes, you need so-called "stubs" for that
<whitequark>
take a look at ocamlmklib
<AlexRussia>
whitequark: no, i've yesterday compile rust from fun(test language on owm computer is fun!), so, it was over 3 hours to compile it use llvm-rust :/
<AlexRussia>
dmbaturin: ...
<companion_cube>
thanks
<AlexRussia>
dmbaturin: how to i then compile first ocalm(3) withou ocaml insystem?
<AlexRussia>
ocaml*
<AlexRussia>
dammit
<AlexRussia>
so, it installed
<whitequark>
AlexRussia: well, your computer is also slow. but even on a modern i7, a single rust stage takes ~10 minutes, and complete bootstrap takes ~30 minutes
<whitequark>
it shouldn't be like that.
<AlexRussia>
whitequark: i don't think i3 is slow, i've hear its fast to compile things
<dmbaturin>
AlexRussia: I've never read the gentoo build script, but it likely pulls precompiled binaries first.
<whitequark>
AlexRussia: i3 is terrible for compiling things, the cache size is too small
<AlexRussia>
dmbaturin: you can read ebuild, its not too much hard to read than any shell script ;)
<companion_cube>
is there a way for oasis to call ocamlmklib for me?
<AlexRussia>
dmbaturin: it may work, i mean, here no usually way - via emerge
teknozulu has joined #ocaml
<whitequark>
Drup: /me . o O ( should I write ppx_nonrec? )
<Drup>
?
<whitequark>
type nonrec t = t
<whitequark>
well, that's how it looks in camlp4. we could have type%nonrec t = t
<whitequark>
but ocaml does not recognize type%... right now, so it would be [%nonrec type t = t] for the time being
<mrvn>
instead of: type z = t type t = z?
<whitequark>
that leaks type z
<AlexRussia>
dmbaturin: what is utop itself?
<mrvn>
the module signature hides it
<whitequark>
you need to do the include-and-destructively-substitute trick
<companion_cube>
almost looks like oasis ignores CCLib and CCOpt...
<companion_cube>
and of course oasis' documentation webpage is down
manud has quit [Ping timeout: 240 seconds]
manud has joined #ocaml
teknozulu has quit [Ping timeout: 250 seconds]
<companion_cube>
is there a way to give -cflags through oasis ?
<companion_cube>
(sorry, but I can't access the documentation :s)
<whitequark>
Drup: I looked at type_conv's nonrec implementation and I don't want to write it anymore
<whitequark>
companion_cube: _tags
<companion_cube>
awwww
<companion_cube>
well, worth trying
<companion_cube>
I guess it's cflags(foo)?
<whitequark>
yes
<companion_cube>
I'm so annoyed by the shitty documentation of oasis and ocamlbuild
<companion_cube>
there isn't a proper list of _tags anywhere I search
<companion_cube>
or even of what I can put in the tag itself
<whitequark>
ocamlbuild -documentation
<companion_cube>
like, ccopt("-I foo/bar")
<whitequark>
it's just cflags(-I foo/bar)
<companion_cube>
well, ocamlbuild -documentation is cryptic, I never understood its meaning
<companion_cube>
Warning: tag "cflags" does not expect a parameter, but is used with parameter "-ccopt '-I ../../libs/quantor-3.0/'" <--- wtf seriously?
<whitequark>
oh, right, -cflag is only a command-line argument
<companion_cube>
;_;
teknozulu has joined #ocaml
<whitequark>
well, just write a myocamlbuild.ml file
<whitequark>
you need some dispatch_combine incantation
<whitequark>
W: No replace section found in file _tags
<whitequark>
it works properly with this patch
<companion_cube>
oh god.
<companion_cube>
thanks.
<companion_cube>
thanks a lot whitequark .
<dmbaturin>
AlexRussia: What languages are you already familiar with?
<companion_cube>
♥
<AlexRussia>
dmbaturin: ruby :D
<AlexRussia>
dmbaturin: yes yes yes, there dynamic types, but it works :D
<whitequark>
companion_cube: I'm not sure I should feel happy about knowing this
<AlexRussia>
dmbaturin: ou,lol
<companion_cube>
well without your help I'm not sure I could sleep this night, out of frustration
<AlexRussia>
dmbaturin: i thought you mean which language are already implement multiple returned types from single function
<AlexRussia>
dmbaturin: i am know C, C++ and Ruby(C# in progress)
<whitequark>
companion_cube: you do take this seriously
<companion_cube>
well for some reason, it makes me quite angry, unlike bugs or programming issues
<dmbaturin>
AlexRussia: I don't know ruby, lol. Functions have exactly one return type, but you implement ad-hoc polymorphism with variant types. There's also parametric polymorphism with parametrized types.
<dmbaturin>
* you can
<whitequark>
in ruby functions return exactly one value as well
jonludlam has quit [Quit: Coyote finally caught me]
<AlexRussia>
dmbaturin: in ruby it may works like that: def foo(x) {if x > 0 Float.new(x) else String.new(x)} for example, i am not sure it executable cause i am not much good with ';' :/
<AlexRussia>
dmbaturin: what is ad-hoc polymorphism?
<dmbaturin>
For ad-hoc polymorphism you can something like "type foo = Foo of float | Bar of string" and "let baz x = match x with Foo x -> <float stuff> | Bar x -> <string stuff>".
<dmbaturin>
* can do
badon_ has joined #ocaml
<dmbaturin>
I need some sleep I think, my typo rate scares me.
badon has quit [Ping timeout: 245 seconds]
manud has quit [Quit: manud]
<AlexRussia>
dmbaturin: haha
<AlexRussia>
dmbaturin: you want to get some sleep right now?
<dmbaturin>
I can't do it right now, that's the problem.
struktured has joined #ocaml
<dmbaturin>
Anyway, by ad-hoc polymorphism I mean implementing a function that can take or return values of some predetermined types.
ollehar1 has quit [Ping timeout: 260 seconds]
badon_ is now known as badon
<whitequark>
ad-hoc polymorphism is essentially the same thing as operator overloading... OCaml doesn't have it
<whitequark>
if implicits ever get merged, they would be an example of it
<dmbaturin>
AlexRussia: The important thing is that baz works with the new foo type, not with float and string directly, so it's still one type.
demonimin has quit [Ping timeout: 260 seconds]
<dmbaturin>
You cannot return either float or string from it, but you can return a value of type foo again.
demonimin has joined #ocaml
<AlexRussia>
whitequark: its one value, its not one type ;)
<AlexRussia>
dmbaturin: hm, then type foo =.... its define new type with properties of string and float same time?
<dmbaturin>
Not quite, it can be either Foo of float, or Bar of string, but no both. It just provides you with a way to distinguish the float kind of foo from the string kind of foo.
<dmbaturin>
Also, if you define two functions with the same name but different type signatures, it will not give you C++ style ad-hoc polymorphism, the second one will just shadow the first one.