mcclurmc has quit [Read error: Connection reset by peer]
<Algebr>
Can C side code arbitrary change the value of a value argument in a C binding? I guess that would mean Seg fault? I'm just wondering about having a record with a mutable field, then that should be fine to mutable from C side?
kushal has joined #ocaml
swgillespie has joined #ocaml
tmtwd has quit [Ping timeout: 246 seconds]
native_killer has quit [Quit: Leaving]
<dsheets>
Algebr, the ocaml gc can change the location of values so you can't keep pointers to them over a gc cycle
<dsheets>
gc cycles can occur at any allocation
<dsheets>
if you don't hold the runtime lock then another thread can run the gc
* dsheets
falls asleep
<Algebr>
say I have an ocaml side record of {mutable thing = bool}, Can't I just set it to false or true on the C side?
<Algebr>
oh darn
<flux>
"Assignments to the fields of structured blocks must be done with the Store_field macro (for normal blocks) or Store_double_field macro (for arrays and records of floating-point numbers). Other assignments must not use Store_field nor Store_double_field. "
<flux>
you can assign it, as long as you do it the way Store_field does it.
<flux>
algebr, ..did you read the "Interfacing C with OCaml" from the manual?-)
<Algebr>
then the mutable keyword makes no difference on the C side?
<Algebr>
yea, I have read it over and over but this is a nuanced topic
<flux>
my understanding is that it's only for constraining the ocaml program
<flux>
C program is pretty much able to break those constraints
<flux>
of course, if you do break them, your OCaml program may work wrong in presence of optimizations
<flux>
..in some point of future perhaps :)
<Algebr>
So like the labels in a record are gone by runtime, since a record and a tuple are the same
samrat has quit [Ping timeout: 272 seconds]
<flux>
yes
<Algebr>
then why use tuples at all, since there's no performance hit vs a record, might as well.
<Algebr>
use records all the time you use a tuple currently
<flux>
well, tuples don't have labels for one :)
<flux>
when you just want to have a pair or triple of values, it's nice!
<flux>
but you could replace all them with type ('a, 'b) pair = { first : 'a; second : 'b }
NingaLeaf has quit [Quit: Leaving]
<Algebr>
sigh, I keep getting a seg fault in caml_modify
NingaLeaf has joined #ocaml
slash^ has joined #ocaml
<Algebr>
found it, my own stupidity. I am coding spoiled by a type system.
jeffmo has quit [Quit: jeffmo]
damason has quit [Ping timeout: 252 seconds]
damason has joined #ocaml
lolisa has joined #ocaml
NingaLeaf has quit [Quit: Leaving.]
Submarine has quit [Read error: Connection reset by peer]
bendiken has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
damason has quit [Ping timeout: 255 seconds]
MrScout has quit [Ping timeout: 244 seconds]
raichoo has joined #ocaml
obadz has quit [Ping timeout: 240 seconds]
obadz has joined #ocaml
bendiken has joined #ocaml
bendiken has quit [Ping timeout: 240 seconds]
Algebr has quit [Ping timeout: 264 seconds]
tmtwd has joined #ocaml
bjorkintosh has quit [Ping timeout: 272 seconds]
jeffmo has joined #ocaml
teiresias has quit [Ping timeout: 250 seconds]
teiresias has joined #ocaml
raichoo has quit [Ping timeout: 256 seconds]
Algebr has joined #ocaml
ely-se has joined #ocaml
elfring has joined #ocaml
<elfring>
Do you know any analysis tools which can display call graphs for OCaml source files?
<flux>
no, but at least it's not difficult to create module dependency graphs
<flux>
with ocamldep and a bit scripting.
raichoo has joined #ocaml
<flux>
oh, and I guess ocamldoc does that already
<flux>
the tool you are proposing would be interesting, though, but it might be a bit difficult to implement in presence of ie. functors
<mrvn>
no more than first class modules
<Algebr>
Why would stuff like that mess up a dependency graph
<mrvn>
hardest would be local modules opened from global values.
<mrvn>
module refs
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<flux>
mrvn, I think yes more, but it depends where you would want to draw the line to
swgillespie has joined #ocaml
<flux>
mrvn, in case of first class modules you would draw the dependency from where the first class modules is created at, not where it's used at
<flux>
doing the latter would be basically impossible anyway
<flux>
unless you create the dependency graphi in a dynamic fashion at runtime (that would be cool too, though)
<mrvn>
flux: normaly a first class module is the same as a record with functions.
<mrvn>
it only gets difficult when it gets mutable.
<flux>
mrvn, and if I pass a record I would expect the dependencies to point to the place where I create the record, so pretty much the same.
swgillespie has quit [Client Quit]
<mrvn>
flux: in a call graph you need the method getting called
<flux>
mrvn, the dependency would then be drawn from the call site to the signature definition
<flux>
mrvn, it would be impossible to draw it actually to the implementation (if doing it statically)
<mrvn>
depends on the case. most would probably trivial and you could trace which module gets passed and then point to the concret function.
<flux>
foo (if Random.bool () then (module1) else (module2)) - but you still need to handle that, even if you have a secret sauce to handle special cases
larhat has joined #ocaml
<mrvn>
flux: that problem at least doesn't exist with functors.
<mrvn>
or can you do it there too without involving local modules?
<flux>
but same piece of code can be instantiated with multiple different functors
<flux>
hmm, I suppose that's not the problem
<flux>
same problem with anything :-)
<Algebr>
What is the most modern/maintained utf library? Camomile was deprecated, right
<flux>
camomile was deprecated?
<mrvn>
worst case is: let m = ref (M);
<Algebr>
I thought it was?
<flux>
well, it's news to me :)
Haudegen has quit [Ping timeout: 264 seconds]
<flux>
but if you don't need full unicide support, there are smaller alternatives
<Algebr>
I want emojis
tmtwd has quit [Ping timeout: 240 seconds]
<Algebr>
I remember being able to do it with camomile
<flux>
what does it mean to be able to do it?
<flux>
is it different from being able to do the letter ä?
<Algebr>
I think it means I was able to figure out how to use the libary =P
<flux>
find an emoji unicode character, copy and paste :-)
<Algebr>
lol
<flux>
what camomile I understand really provides, is things like case-insensitive string comparisons, uppercase/lowercase, ordering comparisons, etc..
<flux>
unicode-compatible regexp-matching, all 8-, 16-, and 32-bit encodings, unicode substrings, unicode character map/set, .. and that's maybe it
<flux>
algebr, I can print emojis without any unicode library: Printf.printf "\xF0\x9F\x98\x81"
<flux>
so a bit better approach is to get the unicode symbol number and convert that to string
<flux>
well, I'm not sure how it's better. perhaps cleaner.
<Algebr>
yea but I mean I want something to handle stuff like I give a unicode code adn you print it out
<Algebr>
ah, yea, you said that
MercurialAlchemi has quit [Ping timeout: 240 seconds]
zpe has joined #ocaml
<flux>
I think this is the reason why other unicode libraries are a bit more popular nowadays:
<flux>
let b = UTF8.Buf.create 10 in UTF8.Buf.add_char b (UChar.chr 0x1f601); Printf.printf "%s\n" (UTF8.Buf.contents b)
<flux>
or maybe there's a shorter way..
larhat has quit [Quit: Leaving.]
MercurialAlchemi has joined #ocaml
octachron has joined #ocaml
darkf_ has joined #ocaml
darkf has quit [Ping timeout: 244 seconds]
xet7_ has quit [Remote host closed the connection]
xet7_ has joined #ocaml
moei has quit [Quit: Leaving...]
bjorkintosh has joined #ocaml
darkf_ is now known as darkf
ely-se has quit [Quit: leaving]
ely-se has joined #ocaml
moei has joined #ocaml
demonimin has joined #ocaml
demonimin has joined #ocaml
oriba has joined #ocaml
<oriba>
there is some new stuff in OCaml (?), ppx-extensions. Whats that about? Is this for OCaml-AST-parsing? Is this OCaml-internal replacement for the external CamlP4/5?
zpe has quit [Read error: Connection reset by peer]
kolko has joined #ocaml
zpe has joined #ocaml
AlexRussia has quit [Read error: Connection reset by peer]
elfring has quit [Quit: Konversation terminated!]
elfring has joined #ocaml
mea-culp` has quit [Read error: Connection reset by peer]
ely-se has joined #ocaml
kolko has quit [Remote host closed the connection]
slash^ has joined #ocaml
bendiken has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ely-se has quit [Client Quit]
bendiken has joined #ocaml
mea-culpa has joined #ocaml
nicoo_ has joined #ocaml
jeffmo_ has joined #ocaml
Khady_ has joined #ocaml
kolko has joined #ocaml
nicoo has quit [Read error: Connection reset by peer]
Khady has quit [Quit: No Ping reply in 180 seconds.]
jeffmo has quit [Read error: Connection reset by peer]
jeffmo_ is now known as jeffmo
bendiken has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
bendiken has joined #ocaml
Khady_ is now known as Khady
NingaLeaf has joined #ocaml
kushal has joined #ocaml
NingaLeaf has left #ocaml [#ocaml]
ely-se has joined #ocaml
tennix has quit [Ping timeout: 255 seconds]
kushal has quit [Ping timeout: 240 seconds]
bendiken has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ely-se has quit [Client Quit]
_andre has joined #ocaml
bendiken has joined #ocaml
picachu has joined #ocaml
jeffmo has quit [Quit: jeffmo]
dsheets has quit [Ping timeout: 244 seconds]
kushal has joined #ocaml
bendiken has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
teiresias has quit [Ping timeout: 250 seconds]
bendiken has joined #ocaml
nicoo_ is now known as nicoo
teiresias has joined #ocaml
yomimono has joined #ocaml
BitPuffin has joined #ocaml
bendiken has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
bendiken has joined #ocaml
ely-se has joined #ocaml
ollehar has joined #ocaml
zpe has quit [Ping timeout: 246 seconds]
bendiken has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
bendiken has joined #ocaml
igoroliveira has joined #ocaml
zpe has joined #ocaml
ely-se has quit [Quit: leaving]
bendiken has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
bendiken has joined #ocaml
ely-se has joined #ocaml
Simn has joined #ocaml
mort___ has joined #ocaml
ely-se has quit [Quit: leaving]
bendiken has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
bendiken has joined #ocaml
nicoo has quit [Ping timeout: 260 seconds]
bendiken has quit [Read error: Connection reset by peer]
bendiken has joined #ocaml
octachron has quit [Quit: Leaving]
Haudegen has quit [Ping timeout: 272 seconds]
yomimono has quit [Ping timeout: 244 seconds]
bendiken has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
bendiken has joined #ocaml
tennix has joined #ocaml
zpe has quit [Read error: Connection reset by peer]
Haudegen has joined #ocaml
ryanartecona has joined #ocaml
ely-se has joined #ocaml
tennix has quit [Ping timeout: 244 seconds]
picachu has quit [Read error: Connection reset by peer]
grouzen has quit [Ping timeout: 244 seconds]
ely-se has quit [Client Quit]
bendiken has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
bendiken has joined #ocaml
nicoo has joined #ocaml
nicoo has quit [Client Quit]
nicoo has joined #ocaml
tennix has joined #ocaml
tennix has quit [Ping timeout: 272 seconds]
enjolras_ has joined #ocaml
bendiken has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
bendiken has joined #ocaml
kushal has quit [Quit: Leaving]
BhavyaM has quit [Quit: Quit the channel]
tennix has joined #ocaml
Cardoe has joined #ocaml
bendiken has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
bendiken has joined #ocaml
tennix has quit [Ping timeout: 264 seconds]
tennix has joined #ocaml
ely-se has joined #ocaml
ely-se has quit [Client Quit]
tennix has quit [Ping timeout: 264 seconds]
kushal has joined #ocaml
tennix has joined #ocaml
mort___1 has joined #ocaml
tennix has quit [Ping timeout: 246 seconds]
mort___ has quit [Ping timeout: 250 seconds]
Muzer has quit [Excess Flood]
Muzer has joined #ocaml
yomimono has joined #ocaml
tennix has joined #ocaml
bendiken has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
bendiken has joined #ocaml
kdas_ has joined #ocaml
tennix has quit [Ping timeout: 252 seconds]
kushal has quit [Ping timeout: 264 seconds]
ryanartecona has quit [Ping timeout: 264 seconds]
enquora has joined #ocaml
enjolras_ has left #ocaml [#ocaml]
bendiken has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
bendiken has joined #ocaml
kdas_ is now known as kushal
kushal is now known as Guest56188
bendiken has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
bendiken has joined #ocaml
Guest56188 is now known as kushal
kushal has quit [Changing host]
kushal has joined #ocaml
tomboy64 is now known as tomboy64|beginne
bendiken has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
samrat has joined #ocaml
bendiken has joined #ocaml
Denommus has quit [Ping timeout: 246 seconds]
kdas_ has joined #ocaml
bendiken has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
kdas_ has quit [Read error: Connection reset by peer]
bendiken has joined #ocaml
kushal has quit [Ping timeout: 250 seconds]
tennix has joined #ocaml
ousado has quit [Ping timeout: 264 seconds]
Denommus has joined #ocaml
ollehar has quit [Ping timeout: 240 seconds]
tennix has quit [Ping timeout: 250 seconds]
ousado has joined #ocaml
ousado has quit [Changing host]
ousado has joined #ocaml
bendiken has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
bendiken has joined #ocaml
yomimono has quit [Ping timeout: 264 seconds]
tennix has joined #ocaml
kushal has joined #ocaml
raichoo has quit [Ping timeout: 244 seconds]
tennix has quit [Ping timeout: 240 seconds]
jwatzman|work has joined #ocaml
bendiken has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
bendiken has joined #ocaml
tennix has joined #ocaml
ely-se has joined #ocaml
yomimono has joined #ocaml
tennix has quit [Ping timeout: 250 seconds]
_whitelogger has joined #ocaml
bendiken has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
bendiken has joined #ocaml
tennix has joined #ocaml
yomimono has quit [Ping timeout: 264 seconds]
Denommus` has joined #ocaml
Denommus has quit [Read error: Connection reset by peer]
picachu has joined #ocaml
tennix has quit [Ping timeout: 250 seconds]
Wickoo has joined #ocaml
Wickoo has quit [Client Quit]
ely-se has quit [Quit: leaving]
grouzen has joined #ocaml
ely-se has joined #ocaml
tennix has joined #ocaml
bendiken has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
bendiken has joined #ocaml
BitPuffin has quit [Remote host closed the connection]
BitPuffin has joined #ocaml
ely-se is now known as ravraa
tennix has quit [Ping timeout: 250 seconds]
sh0t has joined #ocaml
samrat has quit [Ping timeout: 264 seconds]
tennix has joined #ocaml
yomimono has joined #ocaml
bendiken has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
bendiken has joined #ocaml
tennix has quit [Ping timeout: 240 seconds]
elfring has quit [Quit: Konversation terminated!]
samrat has joined #ocaml
tennix has joined #ocaml
ravraa has quit [Quit: leaving]
bendiken has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
bendiken has joined #ocaml
raichoo has joined #ocaml
yomimono has quit [Ping timeout: 256 seconds]
yomimono has joined #ocaml
bendiken has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
bendiken has joined #ocaml
tennix has quit [Ping timeout: 260 seconds]
tennix has joined #ocaml
sh0t has quit [Remote host closed the connection]
rand000 has quit [Ping timeout: 244 seconds]
bendiken has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
tennix has quit [Ping timeout: 246 seconds]
bendiken has joined #ocaml
Denommus` is now known as Denommus
tennix has joined #ocaml
bendiken has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
yomimono has quit [Ping timeout: 250 seconds]
bendiken has joined #ocaml
mort___1 has quit [Quit: Leaving.]
yomimono has joined #ocaml
bendiken has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
bendiken has joined #ocaml
enquora has quit [Quit: enquora]
oriba has joined #ocaml
jao has joined #ocaml
raichoo has quit [Ping timeout: 244 seconds]
grouzen has quit [Ping timeout: 250 seconds]
yomimono has quit [Ping timeout: 265 seconds]
yomimono has joined #ocaml
obadz- has joined #ocaml
ollehar has joined #ocaml
obadz has quit [Ping timeout: 240 seconds]
Guest38 has joined #ocaml
Guest38 has quit [Client Quit]
Guest38 has joined #ocaml
ollehar has quit [Ping timeout: 255 seconds]
samrat has quit [Ping timeout: 244 seconds]
samrat has joined #ocaml
ollehar has joined #ocaml
samrat has quit [Ping timeout: 252 seconds]
slash^ has left #ocaml [#ocaml]
picachu has quit [Ping timeout: 246 seconds]
grouzen has joined #ocaml
Muzer has quit [Excess Flood]
tibor has joined #ocaml
<tibor>
Hi
<tibor>
May I have a question?
<ollehar>
tibor: shoot
<tibor>
Can someone tell me, how can I have a pattern match to check the list elements for example "match a with | (El a) :: (El b) -> ..."
Muzer has joined #ocaml
tomboy64|beginne is now known as tomboy64
<tibor>
I would like to check the elements type
<tibor>
Is it posible?
rom1504 has left #ocaml [#ocaml]
<zozozo>
tibor: well, first, lists in OCaml are homogeneous, meaning that all the elements of the lists have the same type
<companion_cube>
no, types are checked at compile time
<mrvn>
zozozo: except for type _ el = El : 'a -> unit el
picachu has joined #ocaml
Muzer has quit [Excess Flood]
<mrvn>
But that is usualy a useless type because its like a black hole. things go in but they never come out
<mrvn>
tibor: if you want different types in a list then you need to combine them into a single variant type and then put that into the list.
ollehar has quit [Ping timeout: 246 seconds]
<mrvn>
tibor: then you can match on the variants constructors as well as the list.
Muzer has joined #ocaml
psy_ has joined #ocaml
<tibor>
How can I match the variant constructors? Which is the syntax?
darkf has quit [Ping timeout: 246 seconds]
<tibor>
I'm sorry, I'm very busy now :(
bendiken has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ncthom91 has joined #ocaml
bendiken has joined #ocaml
raichoo has joined #ocaml
ingsoc has joined #ocaml
<dmbaturin>
tibor: match xs with (`Foo _) :: (`Bar _) -> ...
<dmbaturin>
* (`Foo _) :: (`Bar _) :: _
<zozozo>
mrvn: sure, but even then, the list elements technically have the same type, ^^
<dmbaturin>
Polymorphic variant constructors are prefixed with ` and they are checked at runtime. You don't have to declare those types even, it will be automatically inferred as [> `Foo of something | `Bar of something]
ryanartecona has joined #ocaml
bendiken has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jeffmo has joined #ocaml
tennix has quit [Ping timeout: 272 seconds]
bendiken has joined #ocaml
tennix has joined #ocaml
<tibor>
dmbaturin: thank you
jeffmo has quit [Ping timeout: 264 seconds]
obadz- is now known as obadz
bendiken has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
bendiken has joined #ocaml
picachu has quit [Quit: Saliendo]
tennix has quit [Ping timeout: 240 seconds]
tennix has joined #ocaml
larhat has joined #ocaml
bendiken has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
bendiken has joined #ocaml
Kakadu has quit [Quit: Page closed]
jeffmo has joined #ocaml
bendiken has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
bendiken has joined #ocaml
BitPuffin has quit [Ping timeout: 264 seconds]
bendiken has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
bendiken has joined #ocaml
kdas_ has joined #ocaml
kushal has quit [Ping timeout: 240 seconds]
ygrek has joined #ocaml
bendiken has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
bendiken has joined #ocaml
tane has joined #ocaml
zpe has joined #ocaml
bendiken has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
kdas_ is now known as kushal
kushal has quit [Changing host]
kushal has joined #ocaml
bendiken has joined #ocaml
moei has quit [Quit: Leaving...]
bendiken has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
bendiken has joined #ocaml
tennix has quit [Ping timeout: 272 seconds]
tennix has joined #ocaml
bendiken has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Algebr has joined #ocaml
bendiken has joined #ocaml
rand000 has joined #ocaml
zpe has quit [Remote host closed the connection]
bendiken has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
yomimono has quit [Ping timeout: 265 seconds]
bendiken has joined #ocaml
ollehar has joined #ocaml
Kakadu has joined #ocaml
bendiken has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
bendiken has joined #ocaml
ollehar has quit [Ping timeout: 246 seconds]
bendiken has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
bendiken has joined #ocaml
Simn has quit [Quit: Leaving]
MrScout has joined #ocaml
bendiken has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
bendiken has joined #ocaml
sinelaw has joined #ocaml
bendiken has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
bendiken has joined #ocaml
sinelaw has quit [Ping timeout: 272 seconds]
bendiken has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
MercurialAlchemi has quit [Ping timeout: 252 seconds]
bendiken has joined #ocaml
sinelaw has joined #ocaml
bendiken has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
bendiken has joined #ocaml
_andre has quit [Quit: leaving]
<sinelaw>
what's a good reference to the type theory behind optional arguments?
ollehar has joined #ocaml
<mrvn>
sinelaw: there is non
<mrvn>
e
<mrvn>
optional argument are syntactic suggar for 'a option
ygrek has quit [Ping timeout: 264 seconds]
<mrvn>
and default values are more syntactic suggar for "let name = match name with None -> default | Some x -> x in"