<npnth>
When using OUnit, how can I assert_raises in such a way that I check that something - anything - is raised? The spec I'm testing isn't specific about exceptions beyond that they exist.
brendan has joined #ocaml
<whitequark>
that's not really a useful test
<johnf>
whitequark: what I was going to ask is I've been using camlp4 to do code transformations is there a better tool for this?
<johnf>
whitequark: I have an AST generated via camlp4 grammer then using the Camlp4Filters.MetaGeneratorExpr generating new data types.
<npnth>
whitequark: Fair enough, I'll give that a shot.
zpe has joined #ocaml
<whitequark>
an OCaml AST? or your own?
<johnf>
whitequark: its my own AST.
ontologiae has quit [Ping timeout: 276 seconds]
<whitequark>
hrm
<whitequark>
can you elaborate? I never used Camlp4Filters.MetaGeneratorExpr.
ontologiae has joined #ocaml
zpe has quit [Ping timeout: 246 seconds]
<johnf>
I'm just exploring this stuff but basically the Grammer spits out a set of types then with Camlp4Fitlers I can do transformations that look like this, meta_my_ast_node _loc f = <:expr< { mytypea = "foo"; mytypeb = f.attribute } >>
<whitequark>
what would that do?
<johnf>
f is type My_ast_node and in the above example I missed the _$f.attribute$_ but I could also create new types.
<whitequark>
so uh, do you create an OCaml AST from your AST? or what?
<johnf>
whitequark: yeah all it does now is reads Grammer -> myAst -> OCaml AST
<johnf>
I'm not sure its really that useful.
<whitequark>
you can do that with ppx and ppx_metaquot
<Leonidas>
also, the Arch Linux System CamlP4 is broken but oh well
<whitequark>
need to update camlp4
<Leonidas>
whitequark: update to what?
<whitequark>
to a new version
BitPuffin has quit [Ping timeout: 246 seconds]
<Leonidas>
I have camlp4 4.02 installed
<whitequark>
4.02.1
<Leonidas>
[ERROR] The package "camlp4" has no version 4.02.1.
<Leonidas>
:-(
<whitequark>
4.02.0+1
<Leonidas>
[NOTE] Package camlp4 is already installed (current version is 4.02.0+1).
<npnth>
Hmm, looks like 'with _' captures the assert_failure, and even 'try assert_failure "A"; with Failure("A") -> assert_failure "Should have raised" | _ -> ()' isn't triggering. I must be using ; wrong or something.
<whitequark>
Leonidas: hmm that's really strange
<whitequark>
make sure you really do use camlp4 from opam
<tautologico>
utop is dying with Fatal error: exception Invalid_argument("Zed_utf8.singleton")
<tautologico>
as soon as I type something
<whitequark>
is your console set to UTF-8?
zpe has joined #ocaml
<tautologico>
yes
<tautologico>
i think, but it always had
q66 has quit [Quit: Leaving]
zpe has quit [Ping timeout: 272 seconds]
shinnya has joined #ocaml
englishm has quit [Remote host closed the connection]
zpe has joined #ocaml
fold has joined #ocaml
zpe has quit [Ping timeout: 246 seconds]
jao has quit [Remote host closed the connection]
rgrinberg has quit [Quit: Leaving.]
jao has joined #ocaml
jao has quit [Changing host]
jao has joined #ocaml
samrat has joined #ocaml
shinnya has quit [Ping timeout: 246 seconds]
fold has quit [Ping timeout: 276 seconds]
manizzle has quit [Ping timeout: 276 seconds]
dnm has quit []
fold has joined #ocaml
cthuluh has quit [Remote host closed the connection]
tautologico has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
npnth has left #ocaml [#ocaml]
rgrinberg has joined #ocaml
sheijk_ has quit [Ping timeout: 268 seconds]
zpe has joined #ocaml
pyx has joined #ocaml
zpe has quit [Ping timeout: 240 seconds]
darkf_ has joined #ocaml
englishm has joined #ocaml
darkf has quit [Ping timeout: 272 seconds]
darkf_ is now known as darkf
rgrinberg has quit [Quit: Leaving.]
boogie has joined #ocaml
darkf_ has joined #ocaml
darkf has quit [Ping timeout: 255 seconds]
pyon has joined #ocaml
darkf has joined #ocaml
darkf_ has quit [Ping timeout: 272 seconds]
darkf_ has joined #ocaml
Muzer has quit [Ping timeout: 255 seconds]
martintrojer has quit [Ping timeout: 255 seconds]
libertas has quit [Ping timeout: 252 seconds]
clog has quit [Ping timeout: 240 seconds]
libertas has joined #ocaml
darkf has quit [Ping timeout: 272 seconds]
pyx has quit [Ping timeout: 260 seconds]
martintrojer has joined #ocaml
darkf_ is now known as darkf
pyx has joined #ocaml
Muzer has joined #ocaml
pyx has quit [Quit: WeeChat 0.4.3]
samrat has quit [Quit: Computer has gone to sleep.]
philtom has quit [Ping timeout: 276 seconds]
kandu has joined #ocaml
zpe has joined #ocaml
zpe has quit [Ping timeout: 240 seconds]
axiles has joined #ocaml
jao has quit [Ping timeout: 255 seconds]
yacks has quit [Ping timeout: 260 seconds]
rgrinberg has joined #ocaml
philtom has joined #ocaml
oscar_toro has joined #ocaml
cthuluh has joined #ocaml
philtom has quit [Ping timeout: 246 seconds]
zpe has joined #ocaml
zpe has quit [Ping timeout: 255 seconds]
WraithM has joined #ocaml
MercurialAlchemi has joined #ocaml
samrat has joined #ocaml
boogie has quit [Remote host closed the connection]
siddharthv_away is now known as siddharthv
clog has joined #ocaml
rand000 has joined #ocaml
zpe has joined #ocaml
fold has quit [Ping timeout: 260 seconds]
fold has joined #ocaml
zpe has quit [Ping timeout: 252 seconds]
Arsenik has joined #ocaml
rgrinberg has quit [Quit: Leaving.]
hhugo has joined #ocaml
oscar_toro has quit [Quit: oscar_toro]
<pyon>
What exactly is the difference between < foo : bar > and < foo : bar, .. > ?
<pyon>
How could using one or the other affect the correctness of my code?
englishm has quit [Remote host closed the connection]
englishm has joined #ocaml
<flux>
well, if it compiles, it will be as correct as before
<flux>
using .. can cause more complicated type signatures. the .. part makes the type polymorphic.
<flux>
however, it can be convenient as well at times, because if you have an object with more methods than just foo, it will need to be cast to < foo : bar > before you can pass it to a function expecting that. not the case if you accepts < foo : bar; .. >
<flux>
I think usually .. is preserved for the particular places that need it for some reason
<flux>
.. is easy if it's in function signature
<flux>
a bit more difficult if it's in a function that's put to a record
octref has joined #ocaml
_twx_ has quit [Ping timeout: 240 seconds]
ygrek has joined #ocaml
<octref>
Hello guys, I had a problem compiling a project. The error says " DynLoader.Error ("/home/pine/.opam/4.01.0/lib/bin_prot/bin_prot.cma", "error loading shared library: dllbin_prot_stubs.so: dllbin_prot_stubs.so: cannot open shared object file: No such file or directory")". Does anyone have any idea how to fix this? I looked up online and someone suggested eval `opam config env` but this doesn't work for me.
BitPuffin has joined #ocaml
<pyon>
flux: Ah!
<pyon>
It is not possible to make a type synonym for an open object type, right?
octref has quit [Quit: leaving]
ygrek has quit [Ping timeout: 272 seconds]
oscar_toro has joined #ocaml
rand000 has quit [Quit: leaving]
MercurialAlchemi has quit [Remote host closed the connection]
<flux>
right. you need to have a polymoprhic part in it: type 'a a = < foo:int; ..> as 'a
<flux>
not sure if it's possible to use the forall quantifier in that case somehow..
MercurialAlchemi has joined #ocaml
zpe has joined #ocaml
ebzzry has quit [Ping timeout: 245 seconds]
zpe has quit [Ping timeout: 268 seconds]
ygrek has joined #ocaml
AltGr has joined #ocaml
fold has quit [Ping timeout: 245 seconds]
ebzzry has joined #ocaml
Submarine has joined #ocaml
Submarine has joined #ocaml
zpe has joined #ocaml
WraithM has quit [Ping timeout: 245 seconds]
siddharthv is now known as siddharthv_away
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
yacks has joined #ocaml
zpe has quit [Ping timeout: 245 seconds]
thomasga has joined #ocaml
<pyon>
module type X = sig type t end;;
<pyon>
module type Y = X with type t = Foo | Bar;;
<pyon>
Why is this illegal?
<def`>
with constraints only accept paths
<pyon>
module type Y = X with type t = [`Foo | `Bar];;
<pyon>
This worked just fine.
<flux>
I think the 'with type t = ' works only for type aliases
<pyon>
I am guessing "with" constraints only accept non-generative type definitions.
<flux>
[`Foo | `Bar] is like an anonymous type so it works
<flux>
(well, not 'like an', it is one)
<def`>
pyon: you're right, the paths case applies to packages, sorry
<pyon>
Oh.
<flux>
I'm sure the ocaml manual on the syntax makes clear what is accepted and what not :-)
<pyon>
I guess in this case I have no choice but to use polymorphic variants.
<flux>
you can do: type t' = Foo | Bar
<flux>
and then use ..with type t = t'
<def`>
flux: but it will be differente
<def`>
as pyon said, it won't be generative in this case
<pyon>
In this case, Foo and Bar are not members of the module.
<def`>
I am not sure why it's prevented
<flux>
well, neither is [`Foo | `Bar] :)
<pyon>
Here is a slightly more complicated scenario: "module type X = sig type t type u end;; module type Y = X with t = u;;" -- Again, this is illegal, and this time I know of no way to make it legal.
<def`>
hmm, yes, the rhs of constraints only refers to the outer scope
<pyon>
Of course, for such a small example, doing "module type Y = sig type t type u = t end;;" does not hurt. But if X is a large signature...
ontologiae has joined #ocaml
zpe has joined #ocaml
cago has joined #ocaml
<Drup>
pyon: I know only one way to do that
<Drup>
pyon: module type Y = sig type t include X with type t := t and u = t end
<Drup>
(assuming t is abstract, ofc, otherwise this whole thing doesn't make sense)
Arsenik has quit [Remote host closed the connection]
Simn has joined #ocaml
<pyon>
Drup: Ah, very nice! Thanks!
Arsenik has joined #ocaml
<pyon>
Drup: By the way, is it really := ?
zarul has quit [Remote host closed the connection]
<gargawel>
That's quite useful when you don't want to clutter your signatures with types
Simn has quit [Read error: Connection reset by peer]
samr has quit [Quit: Page closed]
avsm has joined #ocaml
Submarine has quit [Quit: Leaving]
ygrek has quit [Ping timeout: 240 seconds]
Simn has joined #ocaml
ggole has joined #ocaml
samrat has quit [Quit: Computer has gone to sleep.]
samrat has joined #ocaml
oscar_toro has quit [Quit: oscar_toro]
chambart has joined #ocaml
Kakadu has quit [Ping timeout: 246 seconds]
thomasga has quit [Quit: Leaving.]
_andre has joined #ocaml
fold has joined #ocaml
fold has quit [Ping timeout: 260 seconds]
tane has joined #ocaml
thomasga has joined #ocaml
njcomsec has joined #ocaml
yacks has quit [Remote host closed the connection]
ygrek has joined #ocaml
kaustuv has joined #ocaml
<kaustuv>
Is OCaml's ffi able to call rust? (By "is" I mean "has anyone tried it already")
<whitequark>
kaustuv: haven't tried, but calling extern C'd Rust functions is not different from calling C functions
<whitequark>
so yes
thomasga has quit [Quit: Leaving.]
<adrien_oww>
kaustuv: you go through C
<adrien_oww>
ocaml calls c which calls rust which can call c to call ocaml
BitPuffin has quit [Ping timeout: 245 seconds]
<pyon>
kaustuv: You can disable name mangling in Rust.
<adrien>
but is the ABI compatible?
<whitequark>
yes
<whitequark>
adrien: also, you don't need to go through C
<whitequark>
I mean, if you have ctypes.
<adrien>
I meant in the worse case
<adrien>
meaning you can always call a function from another language provided that language offers a C ffi
bezirg has joined #ocaml
algoriddle has joined #ocaml
avsm has quit [Quit: Leaving.]
<algoriddle>
hello, emacs+merlin2 gives me "Wrong type argument: number-or-marker-p, nil" when I try to locate the definition of anything. any idea what might be the problem?
<def`>
algoriddle: recent build? are you using the latest mode? (can you tell the full path of merlin.el?)
<algoriddle>
i just got everything from opam this morning
<def`>
So you didn't had merlin before?
<algoriddle>
i did use it with 4.01
<algoriddle>
so there are a few merlin.els on my system, perhaps it's loading the wrong one. how can i tell which one is loaded?
<def`>
algoriddle: hehe… remove any merlin.elc to begin with
Submarine has joined #ocaml
Submarine has joined #ocaml
<algoriddle>
ok, done
<algoriddle>
no elcs anywhere
<def`>
and if you try again, the same problem occurs?
<algoriddle>
yes
<def`>
can you show the line relevant to merlin in your .emacs?
<def`>
(appending to load path)
samrat has quit [Quit: Computer has gone to sleep.]
<algoriddle>
(add-to-list 'load-path (concat
<algoriddle>
(shell-command-to-string "opam config var share"))
<algoriddle>
"/emacs/site-lisp"))
<algoriddle>
(replace-regexp-in-string "\n$" ""
<algoriddle>
is this what you meant?
<def`>
yes
<def`>
then, can you run M-x merlin-version in an ml buffer?
ontologiae has quit [Ping timeout: 268 seconds]
<algoriddle>
The Merlin toolkit version git-7a25a6e8a9e6eeb3cfa7e83c32cc6d5438b81e77, for Ocaml 4.02.0
<algoriddle>
i have installed the merlin plugin from elpa as well at some point, could that be a problem? do i need that at all?
<def`>
last thing, M-x locate-library merlin
<def`>
algoriddle: no, installing from elpa is not really a good idea
<algoriddle>
ok, i get rid of elpa first
<def`>
at least, until the protocol is stabilized :P
<algoriddle>
Library is file ~/.emacs.d/elpa/merlin-20140813.234/merlin.el
<algoriddle>
let me get rid of it
<algoriddle>
ok, that was the problem, thank you. i didn't realise that opam installing merlin also installs the emacs plugin
<def`>
no problem, for the time being, merlin.el is quite tied to the merlin binary, because the protocol is evolving (especially for 2.0.0 rc)
<def`>
we advised against integration into elpa afaict, but I don't know the details, I am not an emacs user
<kaustuv>
It seems that you can't run M-x merlin-version from a non tuareg-mode/merlin-mode buffer
<kaustuv>
module aliases are great, but I kind of miss being able to see the inteface of a module Foo in the toplevel by saying module M = Foo
<kaustuv>
(yes, I know about #show_module)
samrat has joined #ocaml
ontologiae has joined #ocaml
<pyon>
Whoa, #show_module is nice. In Standard ML, I had to do "structure M = struct open Foo end;" in the REPL. :-|
<whitequark>
standard ML is known for its terseness and convenience
<pyon>
lol
<ggole>
The OCaml trick used to be struct X = Foo
<adrien>
module X = Foo
<kaustuv>
At least SML has only one kind of record in the language
<ggole>
Er, yeah
<ggole>
Which doesn't actually work now
<ggole>
Also, I fail at reading the scrollback.
<whitequark>
you can do module X = struct include Foo end;;
<whitequark>
a bit more verbose though
<kaustuv>
module type M = module type of Foo ;;
<pyon>
I thought include was for module types. :-|
avsm has joined #ocaml
<whitequark>
it works both ways
thomasga has joined #ocaml
<ggole>
Useful when you want to define some huge datatype and don't want to have to duplicate it
sheijk has joined #ocaml
thomasga has quit [Client Quit]
thomasga has joined #ocaml
darkf_ is now known as darkf
thomasga has quit [Client Quit]
thomasga has joined #ocaml
sepp2k has joined #ocaml
msaegesser has joined #ocaml
thomasga has quit [Quit: Leaving.]
thomasga has joined #ocaml
ernst has joined #ocaml
thomasga has quit [Quit: Leaving.]
thomasga has joined #ocaml
bartbes has left #ocaml [#ocaml]
englishm has quit [Ping timeout: 272 seconds]
ontologiae has quit [Ping timeout: 276 seconds]
englishm has joined #ocaml
samrat has quit [Quit: Computer has gone to sleep.]
stux has joined #ocaml
tinduck has joined #ocaml
darkf has quit [Quit: Leaving]
cantstanya has joined #ocaml
cantstanya has left #ocaml [#ocaml]
Hannibal_Smith has quit [Quit: Sto andando via]
cantstanya has joined #ocaml
AltGr has left #ocaml [#ocaml]
dsheets has joined #ocaml
<pyon>
vals defined inside a class are never visible outside, right?
<adrien>
right
<adrien>
you need accessors
Kakadu has joined #ocaml
englishm has quit [Remote host closed the connection]
englishm has joined #ocaml
AltGr has joined #ocaml
englishm has quit [Remote host closed the connection]
englishm has joined #ocaml
tinduck has quit [Quit: vpn....]
<Drup>
except in the same file.
johnf has quit [Read error: Connection reset by peer]
avsm1 has joined #ocaml
englishm_ has joined #ocaml
avsm has quit [Ping timeout: 255 seconds]
englishm has quit [Ping timeout: 264 seconds]
<ggole>
Eh?
<ggole>
How would you even access one? There's no syntax for it.
englishm_ has quit [Ping timeout: 252 seconds]
<Drup>
if you inherit a class with a value defined in the same file, you can access the value
<ggole>
Oh, I see
englishm has joined #ocaml
cago has left #ocaml [#ocaml]
claudiuc has quit [Remote host closed the connection]
honh has joined #ocaml
englishm_ has joined #ocaml
<honh>
hi
<honh>
would someone help me? i'm having issues with installing eliom with opam
englishm has quit [Ping timeout: 264 seconds]
<honh>
i got merlin installed, and now when i try installing eliom, i get a collection of various, varying errors on packages, most of which being related to the package being installed already
<honh>
i'm on debian xfce
<honh>
earlier i tried installing eliom beforehand, and it worked but i couldn't install any other package (including merlin) because of some fatal error (i forgot which)
<honh>
i think it might have to do with how opam tries to find packages
<Drup>
which version of opam ?
<honh>
(on an unrelated note, i apologize for my english)
<honh>
1.1.1
<honh>
i downloaded it yesterday
<Drup>
huum
<Drup>
do you have aspcud installed ?
<honh>
i don't know what it is but my shell doesn't seem to recognize it, so i don't think so
philed has quit [Ping timeout: 252 seconds]
<Drup>
try to install it, it should be in debian packages
<Drup>
oh, which version of ocaml ?
<honh>
got it
<honh>
i had 4.02, but i did an opam switch 4.01.0 before trying to install eliom
<Drup>
ok
ygrek has quit [Remote host closed the connection]
ygrek has joined #ocaml
morphles has joined #ocaml
philtom has joined #ocaml
sagotch has quit [Remote host closed the connection]
<honh>
i just tried again, it tells me (this is not the first time, but not always the case either) that ocamlfind couldn't be installed
<honh>
but when i type opam install ocamlfind, it tells me it's already installed
<Drup>
there is a bug report about that on github :/
<Drup>
It's an opam issue, not sure I can help you
<honh>
aw
Submarine has quit [Remote host closed the connection]
<honh>
it's problematic, i wanted to use it for a hackathon that's starting tomorrow
<honh>
well thank you anyway
<honh>
it was nice to try
<adrien>
(or you can use 4.01)
<honh>
i already use 4.01 though
<honh>
since i switched
thomasga1 has joined #ocaml
<Drup>
honh: rm -rf .opam
<Drup>
and restart from scratch
<honh>
yeah i guess
thomasga has quit [Ping timeout: 246 seconds]
<Leonidas>
honh: eliom on 4.01.0 from OPAM should work, installed it yesterday this way
<Leonidas>
(different story on 4.02 for now)
bezirg has quit [Ping timeout: 276 seconds]
morphles has quit [Ping timeout: 264 seconds]
<dmbaturin>
honh: OCaml hackathon? Where?
ygrek has quit [Ping timeout: 260 seconds]
<honh>
at Tourcoing
<honh>
but it's not an ocaml hackathon, it's a mobile app one
Denommus has quit [Ping timeout: 240 seconds]
Denommus has joined #ocaml
bytbox has quit [Remote host closed the connection]
claudiuc has joined #ocaml
Thooms has joined #ocaml
claudiuc has quit [Remote host closed the connection]
claudiuc has joined #ocaml
tac_ has joined #ocaml
shinnya has joined #ocaml
ollehar has joined #ocaml
boogie has joined #ocaml
morphles has joined #ocaml
Thooms has quit [Ping timeout: 264 seconds]
honh has quit [Quit: Page closed]
bytbox has joined #ocaml
claudiuc has quit [Remote host closed the connection]
claudiuc has joined #ocaml
bytbox has quit [Ping timeout: 264 seconds]
avsm1 has quit [Quit: Leaving.]
oriba has joined #ocaml
rgrinberg has joined #ocaml
shinnya has quit [Ping timeout: 260 seconds]
_andre has quit [Read error: Connection reset by peer]
malo has joined #ocaml
_andre has joined #ocaml
<_tca>
is there any way to play with modular implicits right now?
<_tca>
nevermind i just updated opam and saw a build was added
morphles has quit [Ping timeout: 246 seconds]
<Drup>
there is also a IOcamljs
chambart has quit [Ping timeout: 255 seconds]
jwatzman|work has joined #ocaml
jonludlam has quit [Quit: Coyote finally caught me]
oriba_ has joined #ocaml
octachron has quit [Quit: Leaving]
oriba has quit [Ping timeout: 245 seconds]
Kron has joined #ocaml
<Kron>
I'm getting a Sys_error "No such file or directory" every time I try to use open_in
<Kron>
what's the syntax? are there any newbie mistakes I may be making?
<asmanur_>
how are you calling open_in ?
q66 has joined #ocaml
troutwine_away is now known as troutwine
Kakadu has quit [Quit: Page closed]
englishm_ has quit [Remote host closed the connection]
AltGr has left #ocaml [#ocaml]
<Kron>
managed to fix it by using an objective path
tobiasBora has joined #ocaml
morphles has joined #ocaml
thomasga1 has quit [Quit: Leaving.]
thomasga has joined #ocaml
avsm has joined #ocaml
ygrek has joined #ocaml
enquora has joined #ocaml
claudiuc has quit [Remote host closed the connection]
zpe has quit [Remote host closed the connection]
claudiuc has joined #ocaml
zpe has joined #ocaml
avsm has quit [Client Quit]
zpe has quit [Ping timeout: 245 seconds]
troutwine is now known as troutwine_away
englishm has joined #ocaml
Kron has quit [Remote host closed the connection]
Kron has joined #ocaml
<Kron>
I can't use the (|-) operator from ocaml-batteries, even though (|>) works just fine
<Kron>
is there a way to get composition running in standard?
claudiuc has quit [Remote host closed the connection]
claudiuc has joined #ocaml
tobiasBora has quit [Quit: Konversation terminated!]
tobiasBora has joined #ocaml
Arsenik has quit [Remote host closed the connection]
<def`>
Kron: no, you have to define your own if you want composition without dependencies
<Kron>
ah
<def`>
(Because of value restriction, that kind of functionals are less useful than in haskell)