<freefunc3>
On one hand, I want to make the user ignorant about the underlying implementation (and enable later development without breaking changes)
<freefunc3>
in addition to that, I'd like to avoid code duplication
<freefunc3>
so my plan was to have all the functions live in the Make functor
<freefunc3>
some would be implemented
<freefunc3>
others would just be alias of functions implemented in the argument module (Format)
<freefunc3>
(just like L31)
<freefunc3>
The thing I am uncomfortable with is that some functions that I was planning to implement in the Make functor are actually only implementable if you know about the actual underlying type of the argument
<freefunc3>
I am the developer so I know that information, but it feels to me that it's a code smell
<freefunc3>
e.g I want to implement a "size" function
<freefunc3>
I know that the two formats (BigEndian and LittleEndian) both use the type string
mbuf|BRB has quit [Quit: Leaving]
<freefunc3>
so my size function would be using String.length
<freefunc3>
it doesn't feel right but I can't think of any alternative that doesn't make me duplicate that function in both Format modules
micro_ has joined #ocaml
sepp2k has joined #ocaml
<kakadu>
def`: hi. I'm trying to compile merling for multicore OCaml. I copied some files but I get an error about unbound Lexer module? should it be something from merlin's source tree or from compiler-libs?
<kakadu>
File "src/ocaml/typer/typing/cmt_format.ml", line 224, characters 21-35:
<Leonidas>
But I don't know how I would implement this decode function. The spec type looks like it is doing the right thing, accumulating arguments but I don't quite know how to make it call the int_of_string etc functions correctly
MercurialAlchemi has quit [Ping timeout: 258 seconds]
<octachron>
Leonidas, you should deconstruct the raw string list at the same time as the spec lists and then just apply f : "(f @@ decode_elem x y)" with y the head of the raw string list
malina has joined #ocaml
dakk has quit [Read error: Connection reset by peer]
zolk3ri has joined #ocaml
dakk has joined #ocaml
freusque has quit [Quit: WeeChat 1.7.1]
dhil has quit [Ping timeout: 240 seconds]
ontologiae has joined #ocaml
sz0 has joined #ocaml
ontologiae has left #ocaml [#ocaml]
ontologiae has joined #ocaml
jonasen has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<kakadu>
def`: should this Lexer module be somehow created from lexer_raw.ml or it is something else?
<def`>
kakadu: sorry, I mean Lexer_raw is merlin's lexer.
<def`>
Lexer is from compiler-libs and is not used by merlin.
<Drup>
Leonidas: dinosaure did something similar called "farfadet"
<kakadu>
def`: Ah, thanks. btw, what is supposed approach to see compilation commands in OCamlMakefile? `make VERBOSE=1` seems not to work
* kakadu
is probably no linking the file with compiler-libs.common so this Lexer module is not found
pmetzger has joined #ocaml
jonasen has joined #ocaml
FreeBirdLjj has joined #ocaml
slash^ has joined #ocaml
ygrek has quit [Ping timeout: 255 seconds]
nahra has joined #ocaml
<def`>
kakadu: no, merlin is not using compiler-libs
<def`>
the dependency on Lexer is removed
<def`>
it is using its own modules for most features, you will have to port the parser and fix the typechecker.
<def`>
(I recommend starting by copy-pasting from an existing typer, maybe typer_402 if that's the version you are starting from)
<def`>
you can make a diff between orig/ocaml_402 and src/ocaml/typer_402 to see the difference between upstream (compiler-libs) and merlin
<def`>
(this is quite hard, learning by tweaking the existing merlin is maybe a bit easier)
ShalokShalom_ has joined #ocaml
<def`>
whenever you modify the lexer and/or the parser, run `make preprocess` to update the generated files
dakk has quit [Read error: Connection reset by peer]
<kakadu>
I understood that issue with Lexer, thanks.
<kakadu>
def`: Do you have someplans to describe all of this somewhere in the wiki?
<kakadu>
I managed to understand that original compiler files need to be fixed manually (for example, this Pconst_string constructor which was called Const_string when it was in Asttypes.ml) but I could get away a thought "WTF, what am I doing"
<wwhite>
I have some problems to understand the "types" syntax and code syntax on those things :\
kakadu has joined #ocaml
<Anarchos>
wwhite what don't you understand ?
kolko has quit [Ping timeout: 248 seconds]
kakadu_ has joined #ocaml
ygrek has joined #ocaml
kakadu has quit [Ping timeout: 260 seconds]
kolko has joined #ocaml
philtor has joined #ocaml
<wwhite>
difference between sumbetween and sumbtw for example :\
ygrek has quit [Ping timeout: 255 seconds]
<Anarchos>
wwhite let me see
<Anarchos>
wwhite the first takes a couple as only argument
Simn has joined #ocaml
<Anarchos>
wwhite the second takes two arguments
<wwhite>
what about sum ? (there are two...)
<wwhite>
how do I understand that type declaration ??
slash^ has quit [Read error: Connection reset by peer]
shinnya has joined #ocaml
AltGr has left #ocaml [#ocaml]
<octachron>
wwhite, do you understand the type of times?
Anarchos has quit [Remote host closed the connection]
Anarchos has joined #ocaml
<wwhite>
uhm, honestly is not that clear :(
<octachron>
so starting from there, "int -> int" reads as: a function taking an int argument and returning an int
<octachron>
then "int -> int -> int" can be read in two equivalent way:
pmetzger has quit [Ping timeout: 248 seconds]
<octachron>
first: a function taking two int arguments and returning an int, for instance "times 2 3" returns "6"
<wwhite>
yeah, I know that.
<octachron>
but, it can also be reads as "int -> (int -> int)": a function taking one int argument and returning "a function taking one ints argument and returning an int"
<wwhite>
that's confusing ...
<zolk3ri>
Funception!
<octachron>
as an example: "times 2" is the function taking one argument and multiplying it by two
<octachron>
or if I define "let times_2 = times 2" then "times_2 3" returns 6
jonasen has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<octachron>
It is confusing right now, let's come back to the type of sum: `sum` is a function that takes two arguments and returns an int.
<octachron>
If it is*
<octachron>
what is the type of the first argument?
pete_8 has joined #ocaml
<wwhite>
sorry but I need to go
<wwhite>
hopefully we can do something more tomrrow :(
wwhite has quit [Quit: leaving]
<pete_8>
Hi! Does the following relative of "map" have a name?: [1; 2; 3; 4] -> [[f 1; 2; 3; 4]; [1; f 2; 3; 4]; [1; 2; f 3; 4]; [1; 2; 3; f 4]].