<def`>
lexeme is the chunk that was consumed by the lexer
<rgrinberg>
Thanks :)
<def`>
set_lexeme_length allows to change its length (it must be a valid length of course :P)
<rgrinberg>
This is quite a useful function. Maybe upstream it?
<def`>
set_lexeme_length lexbuf n => String.length (Lexing.lexeme lexbuf) == n
<rgrinberg>
It should definitely be in dorm stack overflow answer somewhere at least :D
<rgrinberg>
And yeah, that worked for me btw
<def`>
cool
<def`>
String.length (Lexing.lexeme ...) is a bit inefficient (it copies the lexeme), maybe I should add a function to get that too
ia0 has quit [Quit: reboot]
ia0 has joined #ocaml
<Leonidas>
oh great, topkg fails with local switches
<Leonidas>
because it looks into _opam and complains about hygiene
<def`>
it must be ocamlbuild, no?
<def`>
you have to add -X _opam to ocamlbuild I think
<Leonidas>
def`: yes. You mean to the invocation? Or can I somehow add it to _tags?
<hannes>
Leonidas: put "<_opam>: -traverse" into _tags should do the trick
<def`>
^ that
<Leonidas>
hannes: excellent, works :)
mfp__ has joined #ocaml
ziyourenxiang has joined #ocaml
sam_ has joined #ocaml
sam_ has quit [Ping timeout: 246 seconds]
al-damiri has joined #ocaml
copy_ has joined #ocaml
silver has joined #ocaml
kakadu has joined #ocaml
Trou has joined #ocaml
<Trou>
hello, I have an "advanced" question related to ppx. I'd like to have a "syntax helper" that I could use to transform a string to actual ocaml statements
<Trou>
for example (simplified of course) [%helper "aaa:0"] transformed to let aaa = 0 in
<Trou>
for example (simplified of course) [%helper "aaa:0"] transformed to "let aaa = 0 in"
<Trou>
I'm trying to use Ast_mapper, but I'm having a hard time finding which extension point to use
<Trou>
anyone which ppx knowledge could help ? :)
<Trou>
*with
<Drup>
What is your problem exactly ?
<Trou>
let me write a pastebin, it'll be easier
<Drup>
You don't know which node to search for in the AST ?
<Drup>
(alternatively, `let my_decode_fun = [%decodefun "..."]`, and you only generate the function)
<Drup>
(which also has a rather clear semantics that doesn't leak too much)
<Drup>
But yeah, the solution above is okay, given the constraints
bobry has joined #ocaml
http_GK1wmSU has joined #ocaml
http_GK1wmSU has left #ocaml [#ocaml]
sam_ has joined #ocaml
<kakadu>
Folks, it seems that jbuilder isnot freindly wit 4.05. https://paste.in.ua/2846/ Am I missing something or it is a huuuuuuge bugreport?
sam_ has quit [Ping timeout: 260 seconds]
CcxWrk has quit [Ping timeout: 240 seconds]
_andre has joined #ocaml
mbuf has quit [Quit: Leaving]
sam_ has joined #ocaml
<rgrinberg>
Hmm I use jbuilder and 4.05 daily
<kakadu>
rgrinberg: Do you see any sane error reason expept exit 127?
<kakadu>
except*
<Trou>
Drup: looks like it works, thanks a lot !
CcxWrk has joined #ocaml
sepp2k has joined #ocaml
<rgrinberg>
kakadu: seems like jbuilder just invokes the compiler...
<rgrinberg>
can you give it a try without flambda?
sam_ has quit [Ping timeout: 240 seconds]
sam_ has joined #ocaml
<kakadu>
rgrinberg: It seems the same
<kakadu>
I'm currently use an opam switch called `4.05.0+trunk+fp+flambda` but I don't think that the word `trunk` should be there. rgrinberg, can you check which switch do you use?
<theblatte>
I'm trying to load modules built with jbuilder into utop, namely one big .cmo containing all my modules. Loading goes fine with `#load_rec "AllMyModules.cmo;; open AllMyModules;;`, but when I try and use a module `M` I get Error: Reference to undefined global `AllMyModules__M`
<theblatte>
I noticed that jbuilder plays tricks with modules by prepending AllMyModules__ to them when building AllMyModules, I wonder if there's something I can do to teach utop about this convention?
<theblatte>
dunno if it's a jbuilder thing or if ocamlc et al. know about this convention too
<octachron>
jbuilder uses standard module aliases, however I would not be surprised if "#load_rec" does not handle well modules aliases
<octachron>
after verification, "#load_rec" indeed cannot handle module aliases
<theblatte>
:'(
<theblatte>
what's a module alias? I thought it was just "let M = ModuleName"
<octachron>
Module aliases (e.g. "module X = A" ) are a form of symbolic link at the module level
<theblatte>
sorry, s/let/module/ yes
zaquest has quit [Quit: Leaving]
<mrvn>
theblatte: they are like ""let M = ModuleName" except the syntax is a bit different so ocaml knows it's a module.
<theblatte>
does jbuilder inject code to alias M to LibName__M under the hood then?
<mrvn>
theblatte: more likey Lib does
<theblatte>
right :)
<mrvn>
theblatte: module aliases ss often used in libs that have multiple modules that make up the lib as a whole.
<theblatte>
so no toplevel for me if I use jbuilder? jbuilder kind of forces me to define intermediate libraries but then I can't load them in utop...
<mrvn>
why do you need load_rec?
* mrvn
only ever used #require from findlib
<theblatte>
not sure if I need it, that's how I used to load my modules into utop
<theblatte>
just noobing it, really :)
sam_ has quit [Ping timeout: 255 seconds]
<rgrinberg>
theblatte: stay tuned for the next release of jbuilder. It makes loading top levels in dev quite easy
<theblatte>
what does #require want? only #load/#load_rec are documented :/
<rgrinberg>
One command in fact.
<rgrinberg>
If you can't wait the pin jbuilder in dev
<theblatte>
rgrinberg: is there a workaround in the meantime?
<theblatte>
good news that it's coming though :)
<rgrinberg>
I don't know of one. Sorry
<mrvn>
theblatte: I think a META file.
<mrvn>
does #load work if you specify the modules in the right order?
<theblatte>
rgrinberg: too bad
<theblatte>
mrvn: I haven't succeeded in making even this work, it eventually fails with Lib__Foo.cmo and Lib__Foo.cmi make inconsistent assumptions
<theblatte>
rgrinberg: sorry to ask but do you know what sort of timeframe there is for the next release?
<theblatte>
I see it's utop-only, my test uses ocaml instead :x
<rgrinberg>
Yes, the utop command was designed for interactive development
<theblatte>
it was nice to be able to be non-interactive for the test, but the new way of building the toplevel is unlikely to break so the test can die
<theblatte>
rgrinberg: I wasn't trying to write a test, just trying to run `jbuilder utop ...`
<rgrinberg>
yeah, i get it. I wanna see how it fails myself
<theblatte>
ah cool
<theblatte>
I can push a branch somewhere
<rgrinberg>
yes, please. you might be the first user of this feature
<rgrinberg>
and it's already broken :P
<theblatte>
V5
<theblatte>
:)*
<theblatte>
hmm, it won't work for you right now, I need to implement a way to disable the clang stuff otherwise you'll have to first compile clang and that is not pleasant
<theblatte>
I'll ping in a few minutes
sz0 has joined #ocaml
<rgrinberg>
alright cool
Simn has quit [Quit: Leaving]
<rgrinberg>
theblatte: getting there?
<theblatte>
rgrinberg: yep, had to fix the opensource build too, incoming :)
<theblatte>
you can do my code review as well then ;p
freusque has quit [Quit: WeeChat 1.9]
<theblatte>
rgrinberg: to build: clone, then ./build-infer.sh java, then there should be a jbuild inside infer/ (yes, there's an infer/ directory in the infer repo...)
<theblatte>
it will build in a new switch, so you'll need to opam pin jbuilder again. that or build in your current switch and let it set the dependencies to the versions it wants
govg has quit [Ping timeout: 246 seconds]
<theblatte>
to build in your own switch: ./build-infer.sh --opam-switch <switch> java
<rgrinberg>
theblatte: you should delete the .merlin files now btw :)
<theblatte>
rgrinberg: yes, not there yet :) and I'm not sure it works with my multi-directories setup
<rgrinberg>
ugh... javalib requires camlp4
<rgrinberg>
smh
<companion_cube>
:D
<theblatte>
it hasn't kept up with the times :/
<theblatte>
someone should clean it up
<theblatte>
/o\
<rgrinberg>
theblatte: ya'll should just vendor it
<theblatte>
it's inria :)
<rgrinberg>
now i have to reinstall the universe b/c lwt has a depopt on camlp4
<rgrinberg>
what a nightmare
<rgrinberg>
oh well, soon it will end
<companion_cube>
do they use camlp4 to, like, *parse* java?
MercurialAlchemi has joined #ocaml
<rgrinberg>
i barely recall that writing parsers was popular with camlp4 back in the day
<rgrinberg>
just do $ opam show jbuilder and paste the hash
<theblatte>
06b47a73
<rgrinberg>
ok, that is good. and you have utop installed in that switch right?
igitoor has quit [Ping timeout: 255 seconds]
<rgrinberg>
also your workspace file looks weird
<rgrinberg>
you have 3 switches but they're all the same
<theblatte>
[NOTE] Package utop is already installed (current version is 1.19.3).
<rgrinberg>
doubt that matters though, since i'm not getting any error
<theblatte>
rgrinberg: right, I didn't quite get what these were for :p I need to pass different configurations to "jbuild" contexts seemed the way to do it
<theblatte>
and* contexts
<rgrinberg>
you're not really passing different configurations though, aren't you
<rgrinberg>
you can use the same ocaml versions but you should at least name the switches differnetly
<rgrinberg>
when you have more than 1, you need to add the --context param to $ jbuilder utop to select which one you want
<rgrinberg>
can't really do that with the same name
<theblatte>
rgrinberg: the name of the context is used by jbuild to emit different things
<theblatte>
eg, more fatal warnings
<rgrinberg>
oh, that's right yeah it's different
igitoor has joined #ocaml
<rgrinberg>
can i see the full log for when you run $ jbuilder utop infer
<rgrinberg>
the build command for me looks different than yours
<rgrinberg>
try a clean build
<rgrinberg>
oh and upgrade your utop :P
<rgrinberg>
you need 2.0.1 (the jbuilder'd utop)
<theblatte>
rgrinberg: that was a clean build
<theblatte>
rgrinberg: ok, new utop gives me the same errors as you
<theblatte>
some warnings 31 that are fatal
<theblatte>
because extlib :/
<rgrinberg>
try disabling those warnings and seeing if that gives you a working utop
<rgrinberg>
yeah...
<rgrinberg>
or better yet, drop extlib :)
<theblatte>
tell that to javalib :)
<theblatte>
-w -31 is not enough to drop these, is it?
<theblatte>
hold on, I messed it up
<rgrinberg>
shouldn't you just remove them from the jbuild file?
<theblatte>
rgrinberg: it looks like the flags are ignored by the final ocamlc.opt -linkall command
<theblatte>
so I get the default of +31 :|
<rgrinberg>
ah, that's a bummer
<rgrinberg>
i know exactly why that is
<rgrinberg>
you should make a ticket in the jbuilder bug tracker
<theblatte>
alright!
<rgrinberg>
saying that you can't control the warnings for the toplevel
<theblatte>
will do, thanks
asmanur_ has quit [Read error: Connection reset by peer]
copy_ has quit [Quit: Connection closed for inactivity]
al-damiri has joined #ocaml
<theblatte>
rgrinberg: I think the current solution we have with the mlpack is to avoid such w31 conflicts, is it normal that they show up here? infer itself doesn't directly depend on camomille
<rgrinberg>
yup, but utop does :)
<rgrinberg>
I suppose if there was a mode to create a normal toplevel
<rgrinberg>
this wouldn't be an issue
<theblatte>
except for being stuck with ocamltop :p
<rgrinberg>
Warning 31: files /home/rgrinberg/.opam/4.05.0/lib/zip/zip.cma(Zlib) and /home/rgrinberg/.opam/4.05.0/lib/camlzip/../zip/zip.cma(Zlib) both define a module named Zlib
<rgrinberg>
this bit is really mysterious
<theblatte>
currently we're fine with utop though
<rgrinberg>
wtf, lib/zip and lib/camlzip are both instaled by camlzip
<theblatte>
rgrinberg: yes, I think zip is from camlzip
<theblatte>
right
<rgrinberg>
why does camlzip install itself in 2 different places?
<theblatte>
probably for compatibility reasons
<rgrinberg>
but it uses findlib...
<Drup>
(I feel like I'm seeing rgrinberg discover the real world, live :D)
<theblatte>
(haha :D)
<rgrinberg>
haha, i turn a blind eye to all this cruft usually
<rgrinberg>
i know it's not really fixable
<rgrinberg>
seriously though, either camlzip or zip should just be a requires alias in the META
<rgrinberg>
rather than installing the same thing twice
<theindigamer>
Can anyone suggest work-arounds/solutions?
sam_ has quit [Ping timeout: 268 seconds]
<copy_>
theindigamer: `opam pin add ppx_deriving --dev-repo` should work
FreeBirdLjj has quit [Remote host closed the connection]
<theindigamer>
Thanks, that works :)
mengu has quit [Remote host closed the connection]
mengu has joined #ocaml
mengu has quit [Ping timeout: 240 seconds]
Michael__ has joined #ocaml
<Michael__>
If I define a module Make inside a module file F, and inside a module I have a let binding let t = some funtion (), then, what happens when I say module X = F.Make?
<Michael__>
I would like to know if some_funtion () will be executed, and t becomes the result in X
<octachron>
Michael__, in general compilation units' definitions or toplevel expression are executed as soon as the corresponding cm(x)o file is linked
Anarchos has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
<octachron>
and functors are executed when they are applied (same as functions)
<Michael__>
I would like to understand that, I mean, when is it just a let (name) binding, and when it will be an actual variable assignment
SomeDamnBody has joined #ocaml
<SomeDamnBody>
Does anybody know if the ocaml compiler can produce dSYM files?
<octachron>
Michael__, I am not sure what do you mean by "actual variable assignment"?
kakadu_ has quit [Remote host closed the connection]
discreteunit has joined #ocaml
Michael__ has quit [Ping timeout: 260 seconds]
KeyJoo has joined #ocaml
discreteunit has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dakk has quit [Remote host closed the connection]
morfeen has joined #ocaml
discreteunit has joined #ocaml
morfeen has quit [Remote host closed the connection]
TarVanim_ has joined #ocaml
KeyJoo has quit [Ping timeout: 260 seconds]
dreadedfrog has quit [Ping timeout: 248 seconds]
discreteunit has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
peterpp has quit [Ping timeout: 260 seconds]
Ragora has joined #ocaml
sh0t has joined #ocaml
jnavila has joined #ocaml
jnavila has quit [Remote host closed the connection]