<llamatarianism>
the relevant bits are at around lines 36 and 51
<def`_>
Warning: 6 states have shift/reduce conflicts.
<def`_>
Warning: 41 shift/reduce conflicts were arbitrarily resolved.
<def`_>
the relevant bits are here
<llamatarianism>
yeah that too
<llamatarianism>
honestly, no experience writing parsers. just kinda hacking my way along here :P
<llamatarianism>
I know what a shift/reduce conflict *is*, but I'm not really sure how I'd go about finding what's causing it and solving it
<def`_>
the problem is that your grammar is highly ambiguous
<def`_>
menhir --explain will produce a conflict file showing some of the ambiguities
<llamatarianism>
oh, alright
<llamatarianism>
I'll try that. thanks!
<def`_>
however, splitting your grammar in "expr" and "call" is not enough to help.
<def`_>
written this way, the call is redundant and make it worse
<def`_>
you could simply have a
<def`_>
expr: | expr; expr { Call ($1, $2) }
<def`_>
rule
<def`_>
but what you should focus on is "which expressions are allowed in a call position"
<def`_>
even if you have a single "expr" in your abstract syntax, you are allowed to have different in your concrete ones
<def`_>
so split the expr in expr and simple_expr
<llamatarianism>
alright
<def`_>
the simple_expr is what is callable, and it shouldn't contain IF for instance
<def`_>
in your current language
<def`_>
f IF true THEN 5 ELSE 6
<llamatarianism>
ahh I get it
<def`_>
is allowed, but it would probably be better to not allow that without parentheses
<llamatarianism>
thanks a lot for your help :)
<def`_>
you're welcome :)
<llamatarianism>
hurray!
<llamatarianism>
it works! :D
<llamatarianism>
and now I only have 1 shift/reduce conflict to fix
<llamatarianism>
def`_: thanks :)
<def`_>
good
brunoro has joined #ocaml
fluter has quit [Ping timeout: 272 seconds]
fluter has joined #ocaml
<jstolarek>
Drup: the conditional modules run some code that registers them with the main app
<jstolarek>
thanks for showing me your code
average has joined #ocaml
<average>
in FP, what's a predicate for growing a list?
<average>
fold-left shrinks it, tries to reduce it
<jstolarek>
I just had discussion with other team members and we agreed that it would be OK to have optional dependencies, ie. only compile some database backend if the appropriate library is available in the system
<average>
but what about the opposite?
<Drup>
jstolarek: that doesn't change the problem. The difficulty is in conditional linking, not conditional compilation
<ggole>
average: unfold
<jstolarek>
Drup: I am still trying to wrap my head around this
<jstolarek>
but I think yes, the problem is to conditionally link the extra module
<jstolarek>
make just links all the object files into one executable
<average>
ggole: unfold!
AlexDenisov has joined #ocaml
<vbmithr_>
Hi
<ggole>
average: also, see the term 'anamorphism'
<Drup>
jstolarek: first step would be to isolate each part in libraries (one big lib and one for each optional part). Then we can think about the executable :p
<vbmithr_>
Do anyone knows the command to install a local ocaml install as a switch?
<average>
ggole: I'm actually looking for it in XQuery 3.1, but since OCaml and XQuery are both functional languages.. I know there are knowledgeable people here, so I came here
<average>
I'll have a look in the W3C TRs maybe they have an unfold
ohama has quit [Ping timeout: 240 seconds]
wu_ng has quit [Ping timeout: 244 seconds]
<ggole>
They may well not, OCaml doesn't have one in it's (rather small) stdlib
AlexDenisov has quit [Client Quit]
<average>
unfold looks good, I think my main concern is around memory consumption
<average>
what I'd like is to be able to write an iterator of sorts
ohama has joined #ocaml
<average>
that starts from a point, and then like, generates the next one, but has both available, so prev and next
<jstolarek>
ok, so if I git everything correctly I should now write my own myocamlbuild that would convince the build system to link my optional libraries if they are enabled via flags
<jstolarek>
?
<Drup>
you must keep an OASIS section, so that oasis know where to put his stuff
<Drup>
but yes
MercurialAlchemi has joined #ocaml
* jstolarek
wonders if this is going to be as complicated as it looks
<jstolarek>
is that normal that I am getting a warning that myocamlbuild has changed and that a backup is being made?
Algebr has joined #ocaml
<jstolarek>
where do I find documentation for writing myocamlbuild?
libertas has joined #ocaml
<libertas>
Is there an IRC channel for novice ocaml questions or can I just ask it here?
<orbifx-m>
Is there a character that does that same as space, but is printable?
<orbifx-m>
like one can use _ to split numbers
<orbifx-m>
Using line breaks is obviously a solution, but I don't want to use lines for this
<Drup>
libertas: just ask
<Drup>
orbifx-m:
<Drup>
(I'm serious)
<Drup>
(well, half serious, there is really a character here, and it's not a space)
<flux>
orbifx-m, is there some problem you are solving by not just using space?-)
Algebr has quit [Ping timeout: 272 seconds]
<libertas>
I'm trying to calculate the integer square root of a positive integer with this:
<orbifx-m>
Drup: I asked for printable
Sorella has joined #ocaml
<orbifx-m>
flux: I'm doing matrices with 16 parameters
<libertas>
let rec isr n = let factor = n in if factor * factor <= n then factor else isr (n-1)
<libertas>
the problem is that as n (as parameter) changes, factor also changes each time n is decreased
<orbifx-m>
flux: I'm using extra spaces every four parameters now, but I want to using something more terse as a marker
<Drup>
orbifx-m: it's printable
<Drup>
(proof, I just showed it to you :D)
<libertas>
is there a way to fix the initial n to a variable (factor)?
<orbifx-m>
Drup: lol
tobias232323 has joined #ocaml
<flux>
libertas, you probably need to have an internal function
<flux>
libertas, like: let foo n = let rec loopyloop m = if m < n then loopyloop (m + 1) else () in loopyloop 0
<orbifx-m>
Drup: I need a visible marker, something one can readily see
zpe has quit [Remote host closed the connection]
<orbifx-m>
Maybe if there some way of passing multiple values? like (a b c d); but this is treated as 'a' being a function
<octachron>
orbifx-m: for matrix, why not use lists if the type are homogeneous?
<reynir>
orbifx-m: ␣
<flux>
sadly ocaml doesn't support ␣
<ggole>
␣ and then use sed to change it to space? (Yuck.)
<reynir>
Oh
darkf has quit [Ping timeout: 264 seconds]
<orbifx-m>
octachron: if there is a functor in that library
<orbifx-m>
There are row constructors
tobias232323 has quit [Ping timeout: 264 seconds]
agarwal1975 has joined #ocaml
<agarwal1975>
future.0.1.0 depends on solvuu_build, so I’m not so sure deleting solvuu_build from opam is a good idea. Maybe we should just let the opam repo progress naturally and see what happens to old dead packages in some general way. What I can do is submit an update to the descr file to say “DEPRECATED” clearly.
<jstolarek>
what is pdep function used in myocamlbuild?
nicholasf has joined #ocaml
<jstolarek>
I can't find any documentation that would describe API available for writing myocamlbuild :-/
<octachron>
orbifx-m: I am not sure what you are trying to do, but maybe grouping logically parameters together would help? 16 parameters sounds like a lot to remember.
<jstolarek>
but it does not seem to describe functions contained in the source code :-/
<Drup>
yeaah, that's probably old
slash^ has joined #ocaml
fluter has quit [Ping timeout: 272 seconds]
jwatzman|work has quit [Quit: jwatzman|work]
kv has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
fluter has joined #ocaml
tobias232323 has joined #ocaml
eh_eff_ has joined #ocaml
darkf has joined #ocaml
rgrinberg has joined #ocaml
rgrinberg has quit [Client Quit]
rgrinberg has joined #ocaml
wxfdglm has joined #ocaml
brunoro has quit [Ping timeout: 244 seconds]
Denommus has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
orbifx-m2 has joined #ocaml
orbifx-m has quit [Ping timeout: 264 seconds]
TheLemonMan has joined #ocaml
nicholasf has joined #ocaml
orbifx-m has joined #ocaml
nicholasf has quit [Ping timeout: 264 seconds]
orbifx-m2 has quit [Ping timeout: 272 seconds]
Algebr has quit [Ping timeout: 244 seconds]
orbifx-m2 has joined #ocaml
orbifx-m has quit [Ping timeout: 244 seconds]
Algebr has joined #ocaml
octachron has quit [Quit: Page closed]
<jstolarek>
I think I give up
<jstolarek>
I see no way of telling ocamlbuild to link into the executable something that is not a dependency
<Drup>
jstolarek: push everything somewhere, I'll take a shot at it
<jstolarek>
ok, give me a couple of minutes
<jstolarek>
this is all in a horrible state at the moment
<Drup>
(just not right now)
<jstolarek>
I need to clean it up
<jstolarek>
sure, no problem
<jstolarek>
I will get back to it on Monday - I need a rest :-/
<Drup>
yeah, just make sure the whole conditional compilation part is clean, having something that builds an executable without the conditional link, and then I'll take a shot
<jstolarek>
Drup : but I think it would quite hard for you, unless you have a postgres database running ;-)
<jstolarek>
otherwise you won;t be able to tell whether it works or not
<Drup>
don't worry, I'll now ^^'
<Drup>
know*
<jstolarek>
Drup: should I include configure and setup.ml ?
<jstolarek>
or can you use the generated ones?
brunoro has joined #ocaml
<Drup>
I tend to, yes
eh_eff_ has quit [Ping timeout: 272 seconds]
eh_eff_ has joined #ocaml
<jstolarek>
one more question
<jstolarek>
oasis setup-clean -remove
<jstolarek>
this also removes Makefile and configure
<jstolarek>
so this is not a replacement for make clean?
<Drup>
there is already a target make clean, why do you want to replace it ?
<average>
but just like with haskell.. i'm not entirely sure that if i should learn it
<average>
i'm banned in #haskell btw
<average>
because i dared to ask people there how they make money with haskell
<average>
which to me seemed like a very legitimate question
<average>
apparently you get banned for that there
<average>
i asked the question deliberately, especially since there's very few products written in haskell out there and there's a big hype around it, except i've never seen it used anywhere to be perfectly honest.. only talked about and only used in homeworks for universities
<average>
I consider that to be a very useful tool, and it's surprisingly fast
<Algebr>
both aren't exactly widely used industry languages, but I think that OCaml has a great upward swing
<average>
Algebr: what would an upward swing mean?
<Drup>
surprisingly ? :)
<Algebr>
gasche: also..
<Algebr>
!ocamlbuild
<Algebr>
!ocamlbuild_manual
<Algebr>
!manual
<Algebr>
hmm
smondet has quit [Ping timeout: 272 seconds]
<Algebr>
average: upward swing means usage in docker, means mirage, fb. The adoption rate has a positive deriviative
<average>
that's very nice
<average>
about haskell, i know it's used in finance for throw-away prototypes
<average>
but never tell that to people in #haskell, you'll get banned
<average>
that's how they roll
<average>
you either talk monoids and catamorphisms or you get banned
<Algebr>
I wouldn't shortsell haskell or #haskell, focus on the positive :)
<average>
true
<Drup>
average: when what that ?
<average>
Drup: hm?
<Drup>
your discussion on #haskell
<average>
Drup: uhm, i wrote above about it
<Drup>
yes, when was it ?
rgrinberg has joined #ocaml
eh_eff_ has quit [Ping timeout: 264 seconds]
fbmnds has joined #ocaml
<average>
Drup: idk
<average>
Drup: there was a long time that I was contemplating to learn haskell
<average>
Drup: I was just reading these pumped-up posts about it
<average>
Drup: i'm glad i didn't learn it
tobias232323 has left #ocaml [#ocaml]
<Drup>
I was just wondering what kind of discussion would lead to a ban in #haskell, those people are notoriously nice, but I can't find your discussion in the logs in the last 20 days. Anyway, it's not very important, I was just curious :)
<average>
Drup: one of them was quite aggressive even
<average>
Drup: it really disturbed him that someone dare to ask more practical questions
<average>
anyway, learning a new language is an investment
<average>
and I want to make a good assessment, is this a good investment or not
<average>
and haskell isn't, for me.
<average>
it's just not, it's slow, the syntax keeps piling on tons of extensions
smondet has joined #ocaml
<average>
their modules are write-only and then thrown off unmaintained on that cabal thing they got
sh0t has quit [Ping timeout: 244 seconds]
<average>
nobody's really using it, just blogging 1+1 examples of it and then writing tons of pages on how awesome it was that they added one plus one
slash^ has quit [Read error: Connection reset by peer]
Algebr has joined #ocaml
<average>
not long ago, one of them was absolutely sure that banning all ifs is a good thing
brunoro has joined #ocaml
<average>
so he caused this complete circus of a discussion on HN
<Drup>
average: While I'm not the biggest haskell fan, please avoid mindless bashing, this is not really the place. If you want to learn OCaml, there is a great MOOC currently ! ;)
<average>
it wasn't even funny, it was downright stupid
eh_eff_ has joined #ocaml
orbifx-m has joined #ocaml
Algebr has quit [Ping timeout: 272 seconds]
brunoro has quit [Ping timeout: 244 seconds]
orbifx-m2 has quit [Ping timeout: 264 seconds]
orbifx-m2 has joined #ocaml
eh_eff_ has quit [Ping timeout: 272 seconds]
orbifx-m has quit [Ping timeout: 272 seconds]
average has quit [Quit: leaving]
average has joined #ocaml
brunoro has joined #ocaml
SpiceGuid has quit [Quit: ChatZilla 0.9.92 [SeaMonkey 2.40/20160120202951]]
brunoro has quit [Ping timeout: 264 seconds]
orbifx-m has joined #ocaml
orbifx-m2 has quit [Read error: Connection reset by peer]
orbifx-m2 has joined #ocaml
<jmasseo_>
i used LiquidSoap before I ever even heard of OCaml. I'm was like 'wow how did someone write an application like this in this jibber jabber'. :)