<whitequark>
you should already have everything you need for the function
badkins has quit []
<MooseAndCaml>
I guess it would jsut need an extra function parameter for the h :: [] case?
<whitequark>
let rec map_cons f = function h :: ((h2 :: _) as l) -> f h h2 :: map_cons f l | [] -> [] | _ :: [] -> invalid_arg "map_cons"
reem has joined #ocaml
<MooseAndCaml>
thanks that will help me loosen up a bit about making my own map type functions...
yminsky has joined #ocaml
w0rp has quit [Ping timeout: 250 seconds]
reem has quit [Remote host closed the connection]
w0rp has joined #ocaml
reem has joined #ocaml
reem has quit [Remote host closed the connection]
c74d has quit [Read error: Connection reset by peer]
reem has joined #ocaml
c74d has joined #ocaml
zpe has joined #ocaml
reem has quit [Remote host closed the connection]
yminsky has quit [Quit: yminsky]
reem has joined #ocaml
zpe has quit [Ping timeout: 246 seconds]
yminsky has joined #ocaml
reem_ has joined #ocaml
rwmjones has quit [Read error: Network is unreachable]
rwmjones has joined #ocaml
ptc has joined #ocaml
ptc is now known as Guest64295
MrScout has quit [Ping timeout: 250 seconds]
reem has quit [Ping timeout: 265 seconds]
yminsky has quit [Quit: yminsky]
claudiuc has quit [Remote host closed the connection]
Guest64295 has quit [Ping timeout: 250 seconds]
claudiuc has joined #ocaml
rgrinberg has joined #ocaml
ptc_ has joined #ocaml
claudiuc has quit [Ping timeout: 250 seconds]
ggole has joined #ocaml
mabino-pyon is now known as wild-pyon-ter
reem_ has quit [Remote host closed the connection]
reem has joined #ocaml
reem has quit [Remote host closed the connection]
mcclurmc has quit [Remote host closed the connection]
reem has joined #ocaml
reem has quit [Remote host closed the connection]
c74d has quit [Read error: Connection reset by peer]
reem has joined #ocaml
reem has quit [Remote host closed the connection]
c74d has joined #ocaml
reem has joined #ocaml
reem has quit [Remote host closed the connection]
reem_ has joined #ocaml
reem__ has joined #ocaml
reem has joined #ocaml
reem_ has quit [Ping timeout: 265 seconds]
reem__ has quit [Ping timeout: 265 seconds]
reem has quit [Ping timeout: 265 seconds]
wild-pyon-ter is now known as idem-pyon-tent
reem has joined #ocaml
reem has quit [Remote host closed the connection]
rgrinberg has quit [Quit: Leaving.]
reem has joined #ocaml
reem has quit [Remote host closed the connection]
rgrinberg has joined #ocaml
swgillespie has joined #ocaml
<ggole>
Hmm, TIL inheritance can happen dynamically
c74d has quit [Read error: Connection reset by peer]
AlexRussia has joined #ocaml
badon has quit [Ping timeout: 264 seconds]
idem-pyon-tent is now known as im-pyon-stor
<whitequark>
functors?
<ggole>
Just first-class modules will do it
<ggole>
let f (module M : M) = object inherit M.c end
<whitequark>
same difference
<sdegutis>
im back
<sdegutis>
question:
<sdegutis>
are there any legitimate times when objects are really beneficial over just using plain functions and data?
<ggole>
Well, functions can do arbitrary nonsense to calculate the object
<sdegutis>
what i mean is, i have not really found a need for using objects in other functional languages like clojure -- what use are objects and when are they best used in ocaml?
<sdegutis>
also: clojure sucks
<whitequark>
open recursion
<sdegutis>
but thats another note
<sdegutis>
whitequark: wat
<whitequark>
try using google.
<sdegutis>
not loading
<ggole>
You can use them to do things like walk an AST without writing all the usual boilerplate
AlexRussia has quit [Ping timeout: 246 seconds]
<sdegutis>
oh
<sdegutis>
i suddenly feel incredibly stupid
<sdegutis>
ive been programming for enough years that i really ought to know by now how using objects would make walking an ast easier than just using functions/data
<sdegutis>
yet here we are
<ggole>
People tend to avoid the object stuff. It is fairly complicated and not usually necessary.
<sdegutis>
ok
c74d has joined #ocaml
<sdegutis>
fwiw i know more ruby than whitequark so for me its not a matter of not knowing how to do it
<sdegutis>
or rather, i know ruby better than whitequark does
<sdegutis>
its just that i havent paid close enough attention over the years to the trade-offs of using objects over functions/data to be able to recall them at the glance of a phrase
reem has joined #ocaml
reem has quit [Remote host closed the connection]
im-pyon-stor is now known as mabino-pyon
psy_ has quit [Ping timeout: 246 seconds]
c74d is now known as Guest96391
Guest96391 has quit [Read error: Connection reset by peer]
MrScout has joined #ocaml
c74d has joined #ocaml
reem has joined #ocaml
reem has quit [Remote host closed the connection]
<whitequark>
sdegutis: that's a bold assertion
c74d has quit [Read error: Connection reset by peer]
ptc_ has quit [Ping timeout: 264 seconds]
c74d has joined #ocaml
psy_ has joined #ocaml
ghostpl_ has joined #ocaml
milosn has quit [Read error: Connection reset by peer]
ygrek has quit [Ping timeout: 252 seconds]
<rgrinberg>
whitequark: you still hack in ruby?
ghostpl_ has quit [Ping timeout: 250 seconds]
<whitequark>
rgrinberg: a little. keeping parser alive, mainly
milosn has joined #ocaml
AlexRussia has joined #ocaml
MercurialAlchemi has joined #ocaml
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
swgillespie has joined #ocaml
darkf_ has joined #ocaml
darkf has quit [Ping timeout: 250 seconds]
darkf_ has quit [Changing host]
darkf_ has joined #ocaml
darkf_ is now known as darkf
AlexRussia has quit [Ping timeout: 246 seconds]
snikkers has quit [Ping timeout: 252 seconds]
MercurialAlchemi has quit [Remote host closed the connection]
MercurialAlchemi has joined #ocaml
ygrek has joined #ocaml
darkf_ has joined #ocaml
darkf has quit [Ping timeout: 250 seconds]
darkf_ is now known as darkf
matason has joined #ocaml
psy_ has quit [Read error: No route to host]
c74d has quit [Ping timeout: 252 seconds]
c74d3 has joined #ocaml
jneen is now known as jneen|zzz
snikkers has joined #ocaml
reem has joined #ocaml
patronus has quit [Remote host closed the connection]
myst has quit [Ping timeout: 250 seconds]
patronus has joined #ocaml
reem has quit [Remote host closed the connection]
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
swgillespie has joined #ocaml
swgillespie has quit [Client Quit]
snikkers has quit [Ping timeout: 244 seconds]
AlexRussia has joined #ocaml
mort___ has joined #ocaml
matason has quit [Ping timeout: 246 seconds]
tane has joined #ocaml
mort___ has quit [Ping timeout: 264 seconds]
AlexRussia has quit [Ping timeout: 252 seconds]
myyst has joined #ocaml
AlexRussia has joined #ocaml
huza has joined #ocaml
avsm has joined #ocaml
mort___ has joined #ocaml
reem has joined #ocaml
oscar_toro has quit [Ping timeout: 252 seconds]
Haudegen has quit [Ping timeout: 250 seconds]
zpe has joined #ocaml
Haudegen has joined #ocaml
rgrinberg has quit [Quit: Leaving.]
ghostpl_ has joined #ocaml
matason has joined #ocaml
psy_ has joined #ocaml
psy_ has quit [Max SendQ exceeded]
psy_ has joined #ocaml
MooseAndCaml has quit [Ping timeout: 246 seconds]
Snark has quit [Remote host closed the connection]
huza has quit [Quit: WeeChat 0.3.8]
oscar_toro has joined #ocaml
Kakadu has joined #ocaml
govg has quit [Ping timeout: 265 seconds]
myyst is now known as myst
captain_furious has joined #ocaml
avsm has quit [Quit: Leaving.]
matason has quit [Ping timeout: 252 seconds]
robink has quit [Ping timeout: 245 seconds]
nuki has joined #ocaml
badon has joined #ocaml
robink has joined #ocaml
thomasga has joined #ocaml
Simn has joined #ocaml
mort___ has quit [Quit: Leaving.]
yaewa has joined #ocaml
mbac has quit [Quit: ESCAPE]
mbac has joined #ocaml
moei has quit [Ping timeout: 265 seconds]
larhat has joined #ocaml
ontologiae_ has joined #ocaml
yomimono has joined #ocaml
mort___ has joined #ocaml
AltGr has left #ocaml [#ocaml]
elfring has joined #ocaml
ollehar has joined #ocaml
dsheets has joined #ocaml
dsheets has quit [Read error: Connection reset by peer]
Thooms has joined #ocaml
larhat has quit [Ping timeout: 252 seconds]
larhat has joined #ocaml
oscar_toro has quit [Ping timeout: 244 seconds]
reem has quit [Remote host closed the connection]
oscar_toro has joined #ocaml
MrScout has quit [Remote host closed the connection]
mawuli has quit [Ping timeout: 250 seconds]
mawuli has joined #ocaml
Haudegen has quit [Ping timeout: 250 seconds]
hilquias has quit [Remote host closed the connection]
<Drup>
Also, you will note that js_of_ocaml uses object *types* (but not the runtime) quite a lot.
ygrek has quit [Ping timeout: 250 seconds]
avsm has joined #ocaml
Thooms has quit [Quit: WeeChat 1.0.1]
fraggle-boate_ has joined #ocaml
fraggle-boate has quit [Ping timeout: 256 seconds]
mort___ has joined #ocaml
paradoja has joined #ocaml
mort___ has quit [Ping timeout: 240 seconds]
yminsky has quit [Quit: yminsky]
yminsky has joined #ocaml
thomasga has joined #ocaml
yminsky has quit [Quit: yminsky]
shinnya has joined #ocaml
thomasga has quit [Quit: Leaving.]
nuki has quit [Quit: ChatZilla 0.9.91.1 [Iceweasel 31.3.0/20141203072641]]
q66 has joined #ocaml
avsm has quit [Read error: No route to host]
avsm has joined #ocaml
yminsky has joined #ocaml
enitiz has joined #ocaml
yminsky has quit [Quit: yminsky]
mort___ has joined #ocaml
yminsky has joined #ocaml
psy_ has quit [Quit: Leaving]
prsn has joined #ocaml
yminsky has quit [Ping timeout: 246 seconds]
<prsn>
hi! I have come across code which uses '@@' to do something that looks like function application. I don't really understand what else it might be doing, or why it's used if it's doing nothing else, but that's not my question - mostly I've just been extremely frustrated with my inability to find the answer on my own.
<prsn>
None of the ocaml.org docs or cheat sheets seem to mention it
<prsn>
is there a good resource for looking up arbitrary ocaml syntax and being pretty sure to find it?
<dmbaturin>
prsn: @@ is like haskell $
<MercurialAlchemi>
prsn: you can type '(@@)' in utop, too :)
<prsn>
i don't know what utop is, i've been using tuareg's repl
<MercurialAlchemi>
prsn: otherwise, no
<prsn>
but i'll check it out
<MercurialAlchemi>
it's a good repl
<MercurialAlchemi>
I don't use tuareg, but I'd imagine typing the same thing would also give you the signature
<dmbaturin>
let (@@) f x y = f x y
<prsn>
it didn't :/
<MercurialAlchemi>
ah, my imagination is sometimes optimistic
Submarine has joined #ocaml
<MercurialAlchemi>
"no problem, I'm sure it will be done this afternoon"
<prsn>
haha
<dmbaturin>
prsn: Well, it works in any REPL. You type a binding name and the REPL tells you its inferred type.
<prsn>
oh! it did work. i had taken the ''s literally
<dmbaturin>
In this case it refers to an external function though, but you see my point. :)
<prsn>
alright. i'm still kinda confused how anyone learns of @@'s existence, since it doesn't seem to be in the reference manual, but maybe it is in some obvious place and it's just the difficulty of googling for symbols that's hiding it
<dmbaturin>
ocaml.org maintainers are pretty responsive to pull requests.
<prsn>
I'll strongly consider it ;)
<prsn>
er, that was intended to be a :)
<prsn>
i'm not sure what it being a winky-face implies, but i didn't mean it! :P
<whitequark>
for bonus points it might or might not be compatible with syntax in 4.02.1
<octachron>
so a revised syntax for ppx attributes?
<whitequark>
no
<whitequark>
only in p4o
<Jefffrey>
Thank you guys
<Jefffrey>
[1; 2] _ [3; 1] = [1; 2; 3; 1], what's the operator for that?
<Jefffrey>
^ for strings, but for lists?
<ggole>
@
<ggole>
Read the manual
<Jefffrey>
Ok, thanks.
<Anarchos>
Jefffrey (@)
rgrinberg has joined #ocaml
<Anarchos>
- : 'a list -> 'a list -> 'a list = <fun>
MercurialAlchemi has quit [Remote host closed the connection]
MercurialAlchemi has joined #ocaml
travisbrady has quit [Quit: travisbrady]
<Jefffrey>
Yup.
<Jefffrey>
Thank you everybody.
<Jefffrey>
Good night.
Jefffrey has quit [Quit: Leaving...]
ptc_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
travisbrady has joined #ocaml
gargaml has quit [Quit: WeeChat 1.1.1]
travisbrady has quit [Quit: travisbrady]
lordkryss has joined #ocaml
travisbrady has joined #ocaml
travisbrady has quit [Client Quit]
jao has joined #ocaml
jao has quit [Changing host]
jao has joined #ocaml
octachron has quit [Quit: Leaving]
enitiz has quit [Ping timeout: 250 seconds]
rgrinberg has quit [Quit: Leaving.]
MooseAndCaml has joined #ocaml
ygrek has joined #ocaml
enitiz has joined #ocaml
jwatzman|work has joined #ocaml
rgrinberg has joined #ocaml
ghostpl_ has quit [Remote host closed the connection]
jneen|zzz is now known as jneen
olauzon has joined #ocaml
zpe has quit [Remote host closed the connection]
ygrek has quit [Ping timeout: 252 seconds]
snikkers has joined #ocaml
Haudegen has quit [Ping timeout: 256 seconds]
Anarchos has quit [Quit: i come back]
enitiz has quit [Quit: Leaving]
badkins has joined #ocaml
Anarchos has joined #ocaml
ptc has joined #ocaml
ptc is now known as Guest55549
mort___ has quit [Ping timeout: 250 seconds]
Haudegen has joined #ocaml
rgrinberg has quit [Quit: Leaving.]
rgrinberg has joined #ocaml
MooseAndCaml has quit [Ping timeout: 246 seconds]
jleroux has joined #ocaml
travisbrady has joined #ocaml
paradoja has quit [Remote host closed the connection]
Guest55549 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
mjw56 has quit [Remote host closed the connection]
MrScout has joined #ocaml
jabesed has quit [Ping timeout: 250 seconds]
jabesed has joined #ocaml
travisbrady has quit [Quit: travisbrady]
ptc_ has joined #ocaml
travisbrady has joined #ocaml
zpe has joined #ocaml
zpe has quit [Ping timeout: 252 seconds]
jabesed has quit [Ping timeout: 250 seconds]
q66 has quit [Quit: Leaving]
jwatzman|work has quit [Quit: jwatzman|work]
q66 has joined #ocaml
ggole has quit []
jbalint has quit [Ping timeout: 264 seconds]
dsheets has quit [Ping timeout: 245 seconds]
skinkitten has joined #ocaml
skinkitten is now known as alivemouse
alivemouse is now known as bluebird
bluebird is now known as abluebird
avsm has quit [Quit: Leaving.]
jleroux has quit [Remote host closed the connection]
slash^ has quit [Read error: Connection reset by peer]
t4nk547 has joined #ocaml
t4nk547 has quit [Ping timeout: 246 seconds]
Haudegen has quit [Ping timeout: 250 seconds]
zpe has joined #ocaml
IbnFirnas has quit [Ping timeout: 244 seconds]
Anarchos has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
IbnFirnas has joined #ocaml
zpe has quit [Ping timeout: 264 seconds]
abluebird has quit [Quit: Leaving]
Haudegen has joined #ocaml
nickmeha1ry is now known as nickmeharry
kakadu_ has joined #ocaml
WraithM has joined #ocaml
jabesed has joined #ocaml
WraithM has quit [Quit: leaving]
ghostpl_ has joined #ocaml
raphaelss has quit [Quit: leaving]
ptc_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
thomasga has quit [Quit: Leaving.]
rgrinberg has quit [Quit: Leaving.]
ptc has joined #ocaml
ptc is now known as Guest56252
rgrinberg has joined #ocaml
hilquias has quit [Remote host closed the connection]
reem has joined #ocaml
Submarine has quit [Quit: Leaving]
contempt has quit [Ping timeout: 246 seconds]
contempt has joined #ocaml
Haudegen has quit [Ping timeout: 264 seconds]
rgrinberg has quit [Quit: Leaving.]
zpe has joined #ocaml
travisbrady has quit [Quit: travisbrady]
elfring has quit [Quit: Konversation terminated!]
Haudegen has joined #ocaml
zpe has quit [Ping timeout: 246 seconds]
badkins has quit []
kakadu_ has quit [Remote host closed the connection]
skinkitten has joined #ocaml
skinkitten is now known as skink
rgrinberg has joined #ocaml
thomasga1 has joined #ocaml
reem has quit [Remote host closed the connection]
reem has joined #ocaml
captain_furious has quit [Quit: Leaving.]
reem has quit [Remote host closed the connection]
Thooms has joined #ocaml
reem has joined #ocaml
reem has quit [Read error: Connection reset by peer]
reem has joined #ocaml
skink is now known as biggulppuke
rbocquet has joined #ocaml
reem has quit [Remote host closed the connection]
enquora has joined #ocaml
raphaelss has joined #ocaml
reem has joined #ocaml
Reventlov has quit [Remote host closed the connection]
c74d3 has quit [Read error: Connection reset by peer]
badkins has joined #ocaml
Reventlov has joined #ocaml
c74d has joined #ocaml
Reventlov has quit [Read error: error:1408F119:SSL routines:SSL3_GET_RECORD:decryption failed or bad record mac]
Reventlov has joined #ocaml
uris77_ has joined #ocaml
uris77 has quit [Ping timeout: 250 seconds]
tane has quit [Quit: Verlassend]
Guest56252 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
MercurialAlchemi has quit [Ping timeout: 240 seconds]
badkins has quit []
uris77_ has quit [Quit: leaving]
reem has quit [Remote host closed the connection]
reem has joined #ocaml
thomasga1 has quit [Quit: Leaving.]
thomasga has joined #ocaml
trystero is now known as tristero
MrScout_ has joined #ocaml
AltGr has joined #ocaml
MrScout has quit [Ping timeout: 265 seconds]
olauzon has quit [Quit: olauzon]
lordkryss has quit [Quit: Connection closed for inactivity]
labichn has joined #ocaml
reem has quit [Remote host closed the connection]
<labichn>
Hey all. I'm running OCaml 4.00.1 (not my server, unfortunately) and I'm running into a strange error. Somehow ocamlbuild is generating test.mll and test.mly goals for building test.byte, though there are no .mll or .mly files in the source tree. Is this a known bug, or is there any rational reason these goals should be generated?