yacks has quit [Read error: Connection reset by peer]
eikke has joined #ocaml
milosn has joined #ocaml
yacks has joined #ocaml
weie_ has joined #ocaml
weie has quit [Ping timeout: 248 seconds]
emmanuelux has quit [Quit: emmanuelux]
darkf has quit [Changing host]
darkf has joined #ocaml
madroach has joined #ocaml
Leonidas has joined #ocaml
troydm has joined #ocaml
jbrown has joined #ocaml
sgnb has joined #ocaml
SuperNoeMan has joined #ocaml
jonafan has joined #ocaml
lopex has joined #ocaml
fraggle_ has joined #ocaml
orbitz has joined #ocaml
vpm has joined #ocaml
othiym23 has joined #ocaml
jlouis has joined #ocaml
jon-shape has joined #ocaml
bacam has joined #ocaml
smango has joined #ocaml
nicoo has joined #ocaml
emias has joined #ocaml
TaXules has joined #ocaml
pr has joined #ocaml
eikke has quit [Ping timeout: 264 seconds]
Leonidas is now known as Guest38321
sgkim126l has quit [Quit: leaving]
Tekk_ has joined #ocaml
<Tekk_>
anyone know why the ocaml.org 99 problems example 1 is the way it is? "get the last element of a list" is 4 lines long with conditionals
<Tekk_>
(well, kinda conditionals)
<Tekk_>
oh, because mine doesn't handle [], nevermind
<bernardofpc>
in most cases you really want your matches to be total
<bernardofpc>
how you do that (exceptions or options) could depend
<Tekk_>
hmm. is it possible to open modules in subdirectories from the repl?
<Tekk_>
at least in debian, ocamlnet is split into subdirectories in /usr/lib/ocaml
<Tekk_>
I can't seem to find anything about using it interactively though
clog has joined #ocaml
walter has joined #ocaml
walter has quit [Client Quit]
leoncamel2 has joined #ocaml
yacks has quit [Read error: Connection reset by peer]
yacks has joined #ocaml
TDJACR has quit [Quit: Leaving :D]
tootooroo has joined #ocaml
tootooroo has quit [Read error: Connection reset by peer]
frogfoodeater has joined #ocaml
tootooroo has joined #ocaml
frogfoodeater has quit [Ping timeout: 260 seconds]
Kakadu has joined #ocaml
gnuvince has quit [Remote host closed the connection]
breakds has joined #ocaml
tootooroo has quit [Ping timeout: 256 seconds]
tootooroo has joined #ocaml
tootooroo has quit [Ping timeout: 245 seconds]
frogfoodeater has joined #ocaml
tootooroo has joined #ocaml
mattrepl has quit [Quit: mattrepl]
<orbitz>
Tekk_: use ocamlfind
Yoric has joined #ocaml
Remjey_ has joined #ocaml
Remjey_ is now known as Remjey
frogfoodeater has quit [Ping timeout: 256 seconds]
breakds has quit [Quit: Konversation terminated!]
frogfoodeater has joined #ocaml
frogfoodeater has quit [Ping timeout: 264 seconds]
ttamttam has joined #ocaml
yacks has quit [Ping timeout: 256 seconds]
yacks has joined #ocaml
ollehar has joined #ocaml
<Remjey>
hey, i'm new to ocaml and wanted to have a look at sources of a medium-sized ocaml application with good practices and comments included. i've tried to explore mldonkey a little but it's mostly uncommented and the code seems doesn't seem to be very homogenous
<Remjey>
what application would you recommend ?
<Remjey>
(background: i'm a java developper working with large industrial-quality applications, and did some haskell and lambda calculus in university)
<Kakadu>
maybe ocaml-java will be interesting to u but I have never looked at its code
<flux>
remjey, have you also looked at unison, or is it too small?
<flux>
although I fear most of the code does have few comments :)
frogfoodeater has joined #ocaml
<flux>
but, in my opinion, the most important thing is that the interfaces are clear and properly documented - even the internal ones
frogfoodeater has quit [Ping timeout: 264 seconds]
<Remjey>
i'm downloading both, thanks :)
Snark has joined #ocaml
adrien_ is now known as adrien
<wmeyer>
Remjey: I'd advise for many reasons not to look at mldonkey
<adrien>
it's not _that_ ugly :P
<wmeyer>
Remjey: even maintainers says that mldonkey is a bit special, in terms of quality
<adrien>
8000 lines of code mixing tabs and spaces can only be good imho
<adrien>
(8000 in a single file)
<wmeyer>
adrien: that's what I was actually told by ygrek
<wmeyer>
Remjey: I'd suggest some literate code, maybe ocaml-burg? it's complicated but that's the one example I know that does in lterate way
<adrien>
I can only agree: I gave up doing some changes I wanted to do...
<wmeyer>
:-)
Nahra has quit [Remote host closed the connection]
Nahra has joined #ocaml
ollehar has quit [Ping timeout: 246 seconds]
tootooroo has quit [Quit: Brain.sys has encountered a problem and needs to close. We are sorry for the inconvenience.]
tane has joined #ocaml
ttamttam has left #ocaml []
<wmeyer>
Remjey: you can also always look at some libraries, my advise would be: cmdliner
<wmeyer>
or you can have a look at ocaml source code itself
<wmeyer>
ocamlgraph if you want some advanced usage of functors
tootooroo has joined #ocaml
ontologiae has joined #ocaml
frogfoodeater has joined #ocaml
mathieui has quit [Ping timeout: 252 seconds]
mathieui has joined #ocaml
frogfoodeater has quit [Ping timeout: 256 seconds]
frogfoodeater has joined #ocaml
tootooroo has quit [Ping timeout: 248 seconds]
ggole has joined #ocaml
contempt has quit [Ping timeout: 255 seconds]
tootooroo has joined #ocaml
contempt has joined #ocaml
tootooroo has quit [Client Quit]
anderse has quit [Read error: Connection reset by peer]
anderse has joined #ocaml
anderse has quit [Client Quit]
ulfdoz has joined #ocaml
gustav_ has joined #ocaml
q66 has joined #ocaml
ousado has quit [Ping timeout: 255 seconds]
Yoric has quit [Ping timeout: 246 seconds]
ousado has joined #ocaml
<ousado>
anyone seen this? /tmp/camlasm712ade.s: Error: .size expression for camlSwf__to_float16_1011 does not evaluate to a constant
<ousado>
ocaml 3.11.2-1, OS Ubuntu 10.04 LTS
<ousado>
when building the haxe compiler
<ousado>
x86_64 architecture
ttamttam has joined #ocaml
yacks has quit [Read error: Connection reset by peer]
smerz has joined #ocaml
<Remjey>
wmeyer: thanks
frogfoodeater has quit [Ping timeout: 246 seconds]
<Remjey>
it's funny how modules can do lots of things classes do
anderse has joined #ocaml
Anarchos has joined #ocaml
emmanuelux has joined #ocaml
frogfoodeater has joined #ocaml
yacks has joined #ocaml
<wmeyer>
Remjey: they are strictly more powerful. However classes can do different things, that modules can't without some boilerplate
<wmeyer>
ousado: I think I saw it
mort___ has joined #ocaml
<ousado>
ah, when searching for "size expression does not evaluate to a constant ocaml" I get a few hits
<wmeyer>
it's so cold here, and the heater behaves undetermistically. I have mastered OCaml but haven't found yet how to make use these *two* knobs to get heating straigth away.
<wmeyer>
and worse there is no manual for these two knobs
<wmeyer>
(even if I was today in a mood of reading manuals at all)
<companion_cube>
write an infinite loop, and use it to heat with your CPU
<wmeyer>
lol
<wmeyer>
thank you, I have intel so it should work without hitch
<wmeyer>
if that was ARM situation wouldn't be so simple
<companion_cube>
:D
<wmeyer>
companion_cube: I see people are busy today, extremely busy
<wmeyer>
last comment was ousado 2 hours ago
<wmeyer>
today i can't even focus on anything in particular
<pippijn>
I always feel hostile when someone says they "mastered" something
<wmeyer>
ok i have not, but no longer begginer :-)
<wmeyer>
sorry, i should not say that
<wmeyer>
but feel natural, that's what i meant
<pippijn>
yeah
<wmeyer>
so the problem with "mastered" is that implies the best skills ever which is subjective
tane has quit [Quit: Verlassend]
<wmeyer>
nobody is able to say about her/him/self that have done it, otherwise it's a nice compliment from somebody elese
<pippijn>
right
<wmeyer>
i am a bit brain dead today :-) maybe the temperature in my flat
* ousado
oh noes
<ousado>
wmeyer: take a walk, maybe, or a nap. you can't be brain dead today, it's Fan time
ttamttam has left #ocaml []
<wmeyer>
ousado: thanks, but have no idea if i want to go outside today actually. However, I am getting better at the moment, it's getting hotter. I have some idea what to do with Fan.
<wmeyer>
and i should really shut ERC and just do this :-)
* ousado
shuts up
UncleVasya has joined #ocaml
<companion_cube>
I'm totally useless today
<wmeyer>
feel the same
<wmeyer>
maybe it's spring
<companion_cube>
or just the weekend
yezariaely has quit [Excess Flood]
yezariaely has joined #ocaml
yezariaely has quit [Max SendQ exceeded]
yezariaely has joined #ocaml
yezariaely has quit [Max SendQ exceeded]
yezariaely has joined #ocaml
zpe has joined #ocaml
yezariaely has quit [Max SendQ exceeded]
yezariaely has joined #ocaml
yezariaely has quit [Excess Flood]
<bernardofpc>
companion> write an infinite loop, and use it to heat with your CPU -> emerge -e system on a Prescott
yezariaely has joined #ocaml
yezariaely has quit [Max SendQ exceeded]
yezariaely has joined #ocaml
yezariaely has quit [Max SendQ exceeded]
yezariaely has joined #ocaml
yezariaely has quit [Max SendQ exceeded]
<companion_cube>
bernardofpc: or libroffice
_yezariaely has joined #ocaml
UncleVasya has quit [Ping timeout: 256 seconds]
zpe has quit [Ping timeout: 276 seconds]
* wmeyer
with Andreas Schiff tour
_yezariaely has quit [Excess Flood]
yezariaely has joined #ocaml
yezariaely has quit [Max SendQ exceeded]
yezariaely has joined #ocaml
yezariaely has quit [Max SendQ exceeded]
* wmeyer
hesistates to have a cup of coffee after 2 weeks of coffee break
yezariaely has joined #ocaml
yezariaely has quit [Max SendQ exceeded]
yezariaely has joined #ocaml
yezariaely has quit [Max SendQ exceeded]
<bernardofpc>
don't do drugs ^^
yezariaely has joined #ocaml
yezariaely has quit [Max SendQ exceeded]
<wmeyer>
bernardofpc: I don't, caffeine is socially approved :-)
Yoric has quit [Ping timeout: 256 seconds]
<wmeyer>
but i try to stay away from that
Neros__ has joined #ocaml
Neros_ has quit [Ping timeout: 258 seconds]
<Tekk_>
orbitz: how would the package manager help in this case?
<wmeyer>
Tekk_: [#require "package"];; will set it up for you
<Tekk_>
wmeyer: oh, I thought he meant that I wouldn't have to worry about it if I installed through ocamlfind
<wmeyer>
otherwise [#directory "directory";;] will also do, and you have to #load *.cm[oa] file and have possibly cmi file on path
<Tekk_>
wmeyer: and that's all still interactive? that's the bit I'm most interested in. ocamlfind doesn't seem to have a command to drop me into a repl
<Tekk_>
(bit of a python/lisp workflow of just trying things out interactively, then actually coding it)
<wmeyer>
Tekk_: yes, it will be interactive
<wmeyer>
you can use ocamlmktop tool too
<Tekk_>
hmm
<Tekk_>
wmeyer: with what option to ocamlfind? I'm not seeing anything that fits in the man page
<wmeyer>
ocamlmktop takes the usual compiler options and produced a toplevel
<wmeyer>
that you can execute, and evaluate your expressions
<wmeyer>
looking at the best options for you, I'd suggest strongly uTop
<wmeyer>
as a toplevel, it has a lot of nice enhacements and user interface is quite nice, does work pretty well with Emacs and console, and (I think) have some interface with VIM
<Tekk_>
ocamlmktop is an interesting way to do it
<wmeyer>
maybe because in Lisp community it's common to dump image and load it later, I suppose
<wmeyer>
and it a bit reflects that work flow
<Tekk_>
mhm
<wmeyer>
however I don't use it very often
<Tekk_>
still not working :/ ocamlmktop -I /usr/lib/ocaml/netclient still says that Http_client isn't found
<orbitz>
Tekk_: I'm confsued about what you want
<orbitz>
you want to be in a REPL where yo ucan use your lib
<orbitz>
but wmeyer gave you repl commands to open your lib
<orbitz>
and you say that isn't what you want
<Tekk_>
oh, okay
<Tekk_>
orbitz: I want what you thought I wanted
<orbitz>
Tekk_: if the package is setup as something that works with ocamlfind
<orbitz>
then in ocaml you can do #use "topfind";; #require "yourlib";;
<orbitz>
now you can use it
<Tekk_>
oh, okay. thanks
<Tekk_>
I was a bit confused as to what you meant by "use ocamlfind"
<orbitz>
topfind is part of ocamlfind
<wmeyer>
ocamlfind is our library manager, it's widely used to manage the structure of file system and feed the options to the compiler. However then the library you use need to be packaged with ocamlfind, some of them are not, then instead you have to supply each option by yourself
<wmeyer>
is that clearer picture?
<wmeyer>
:-)
<wmeyer>
it does not preclude of using toplevel however
<Tekk_>
yeah. it's more like a hybrid of pkgconfig and a package mananger than just a package manager :)
<wmeyer>
but it's awkward to setup this options unfortunately
<wmeyer>
it's more like pkgconfig
<wmeyer>
on top of that you have OPAM too, where you can manage also other parameters
<Tekk_>
that's weird..
<wmeyer>
like compiler used or version of the package
<Tekk_>
#use "toplevel";; #require "netclient";; open Http_client;; http_get;; <- http_get not found
<wmeyer>
it's not, it works, it's layered abstraction
<Tekk_>
all the other commands seem to be fine though
<wmeyer>
maybe it's deprecated value
<Tekk_>
maybe
<wmeyer>
the problem is that, if you use ocamlfind you will not learn ever at some point compiler options ;-)
<Tekk_>
wmeyer: nope, include Http_client;; shows a http_Get in there
yezariaely has joined #ocaml
<Tekk_>
http_get*
<orbitz>
Tekk_: what about Http_client.http_get;;?
<Tekk_>
same unbound value
<orbitz>
so it's not in Http_client then :)
<wmeyer>
while I agree that toplevel would be better with some additional directives, I think I am quite happy what is now
<orbitz>
Tekk_: http_Get or http_get?
<Tekk_>
oh
<Tekk_>
hold on
<Tekk_>
it's under the convenience submodule :)
<wmeyer>
Tekk_: OCaml is quite strict about how you write identifiers
<orbitz>
Tekk_: http_get is not in the docs i just found
<malc_>
wmeyer: you want to have one page visible on the screen at a time?
<wmeyer>
try it yourself, if you give me a way of using llpp and having a nice page placed in the centre I'd be happy
<wmeyer>
exactly
<wmeyer>
evince does it
<malc_>
press 'p' press 'ctrl-3'
<wmeyer>
not working
<wmeyer>
nothing happens
<malc_>
get git version of llpp? :)
eikke has joined #ocaml
tootooroo has quit [Quit: Brain.sys has encountered a problem and needs to close. We are sorry for the inconvenience.]
<wmeyer>
that answers my question malc_ and thanks for llpp!
<malc_>
da rien
<wmeyer>
(not sure if it will work still but it looks promising as C-3 was not on menu)
groovy2shoes has quit [Quit: Computer has gone to sleep]
groovy2shoes has joined #ocaml
<wmeyer>
ok works
<wmeyer>
there is a bug however
<wmeyer>
if I use this mode
<wmeyer>
backspace is not working for the previous page
<malc_>
backspace never worked for previous page.. delete is the key
groovy2shoes has quit [Quit: Computer has gone to sleep]
eikke has quit [Ping timeout: 256 seconds]
<wmeyer>
it works except the page is positioned on the top of my display
<wmeyer>
but i want this to have to margins in the bottom and top
<malc_>
press ctrl-- a couple of times
ttamttam1 has joined #ocaml
<malc_>
what you did is this 'p' - turns on "presentation" mode i.e. one page per screen, ctrl-3, fit page model
<Remjey>
just curious, is there some nice ide to work with ocaml projects ?
tootooroo has joined #ocaml
tootooroo is now known as Guest31898
ttamttam1 has quit [Client Quit]
ttamttam has quit [Quit: ttamttam]
<wmeyer>
ok it was 'P' not 'p' i tried
Guest31898 has quit [Ping timeout: 246 seconds]
<malc_>
wmeyer: erm.. and you were correct 'P' is the right key
<malc_>
wmeyer: if you want to navigate to the next page/previous page while keeping things centered you either use space/delete or up/down arrow, not page up/down
<wmeyer>
I figured that out
<wmeyer>
there is help, i tried to use with the previous version of llpp, but the search wasn't working on the help page
<wmeyer>
so it wasn't not immediataly useful
<malc_>
wmeyer: it does work
<malc_>
in a bizzare way but it does work indeed
<wmeyer>
I think it's a useful feature
<wmeyer>
often i want to find something on a help page like 'crop'
<wmeyer>
so I pressed / and then typed 'crop' and nothing
<wmeyer>
but now it actually works
<malc_>
wmeyer: just type crop without /
<malc_>
ctrl-s/r to search forward/backwards after that
<wmeyer>
ok that seems to operate correctly
emmanuelux has quit [Read error: Connection reset by peer]
<wmeyer>
i almost dropped llpp, after i changed my screen to vertical position, but the new git version is way better
walter has joined #ocaml
<malc_>
good to hear that
Kakadu has quit [Ping timeout: 258 seconds]
mattrepl has quit [Quit: mattrepl]
Kakadu has joined #ocaml
mattrepl has joined #ocaml
walter has quit [Quit: This computer has gone to sleep]
smondet has joined #ocaml
answer_42 has joined #ocaml
anderse has quit [Ping timeout: 276 seconds]
smondet has quit [Ping timeout: 246 seconds]
groovy2shoes has joined #ocaml
tootooroo has joined #ocaml
<wmeyer>
Remjey: Emacs with tuareg and optionaly caml-type or caml-spot, Emacs with typerex, Emacs with caml-mode, VIM with some mode (Markus Mottl has done excellent support for VIM AFAIK), Eclipse with OCaide or ODT (haven't tried), Camelia (abandonded), Cameleon (interesting and active).
<wmeyer>
I use tuareg
<wmeyer>
bare tuareg
<wmeyer>
and don't forget about toplevel, the best one is uTop, works in console or Emacs
<bernardofpc>
why are there many toplevels ?
<orbitz>
there aren't that many
<orbitz>
afaik only ocaml and utop
<bernardofpc>
oh
<bernardofpc>
and utop is more "moving" while ocaml is more stable ?
cdidd has quit [Read error: Operation timed out]
<wmeyer>
bernardofpc: yes
derek_c has joined #ocaml
<wmeyer>
bernardofpc: to be precise ocaml toplevel is just enough to run testing scripts
derek_c has quit [Client Quit]
derek_c has joined #ocaml
malc_ has quit [Quit: leaving]
derek_c has quit [Quit: Lost terminal]
derek_c has joined #ocaml
<ousado>
wmeyer: sorry for pestering, but how's Fan?
<wmeyer>
so I try to implement theorem prover in Fan, but haven't finished the rudimentary support for that. Maybe I will start with a parser at first.
<wmeyer>
Means a simple one :-) but not prolog.
<wmeyer>
another idea to put into demos directory maybe less ambitious, is to write a LOGO interpreter
<wmeyer>
orbitz: try uTop :-)
<wmeyer>
it's a great tool
<wmeyer>
do you use Emacs or VIM?
<ousado>
wmeyer: you're very inspired by Coq it seems :)
<wmeyer>
don't say it, please no coq in the mean time
<wmeyer>
i got it over my head for too long
<wmeyer>
and eventually i discovered that i want just to write some ML code, to help myself not forget about OCaml
<wmeyer>
ousado: LOGO isn't anything like this at all
<wmeyer>
it's a language to teach children programming
<ousado>
yes, I know - but I was referring to the theorem prover
<Leonidas>
19.1.2 says user primitives are created with CAMLprim value …
<Leonidas>
but the example in 19.6 does not use CAMLprim at all
<wmeyer>
I don't think it's needed.
<wmeyer>
or maybe, for bytecode compiler?
<Leonidas>
also, I think there's another documentation error in the example, because the examples use external … = "curses_…" but the functions in the C file are "caml_curses_…"
<Leonidas>
I haven't tried compiling it, though.
<wmeyer>
no, there might be bugs, and I don't like it
<wmeyer>
but it's because I don't think the examples get compiled
<Leonidas>
I'll try that later, but at the moment I'm fighting with the gc :-(
ocp has joined #ocaml
<Leonidas>
ok, another question: when do I need CAMLlocal?
tianon has joined #ocaml
<Leonidas>
am I right in assuming that I only need CAMLlocal if I want to have a local variable of type 'value'?
<wmeyer>
Leonidas: always for values, and always first in the function, before any other
<wmeyer>
variables
<wmeyer>
and always use CAMLreturn and CAMLparam
<wmeyer>
for values
<Leonidas>
I'm learning about CAMLreturn the hard way now
<Leonidas>
since if you use regular return and leave out CAMLparam it looks like things are fine
<Leonidas>
untill the GC kicks in
<wmeyer>
use pastebin :-)
<Leonidas>
wmeyer: what about functions I use internally without exposing them to OCaml code?
<wmeyer>
one rule: if you don't allocate memory in them it's fine
<wmeyer>
if you do any runtime interaction, then you have to tell the gc about stack
<wmeyer>
the basic interaction is allocation, that may trigger collections or compatification
<wmeyer>
of course use these macros only for the Caml values
<wmeyer>
otherwise of course surely some bad things happen
Snark has quit [Quit: leaving]
<Leonidas>
wmeyer: oh, that explains why sometimes functions just work. so it is only when I allocate stuff.
<Leonidas>
I think if I just use CAMLreturn everywhere I return a 'value' type, I should be on the safe side
<wmeyer>
yes Leonidas, it only happens when GC kicks in, and that's on entry points to gc
<wmeyer>
sure use macros you are safe
<wmeyer>
another rule
<wmeyer>
don't do any allocations using small_alloc when you prior allocated a block and didn't finish updating it
<Leonidas>
now that you mention it, it makes sense and is quite obvious.
nimred has joined #ocaml
nimred has quit [Changing host]
nimred has joined #ocaml
<Leonidas>
I only do caml_copy_string and caml_alloc_custom
<wmeyer>
the best is to allocate all the stuff assign to values and then put into your data structure
<wmeyer>
so you are then safe just by using macros
mattrepl has joined #ocaml
<Leonidas>
wmeyer: thanks :-)
<wmeyer>
Leonidas: you are welcome :-)
<Leonidas>
wmeyer: expect maybe another bug report later about the example code, I'll try compiling it.
<wmeyer>
it will be fixed immediately
<wmeyer>
(almost)
<Leonidas>
:D
<Leonidas>
one can always depend on wmeyer :-)
<wmeyer>
but maybe tomorrow :-)
<wmeyer>
sure, the documentation bugs are important
<wmeyer>
especially small typos, are easy to fix, and help people
<Leonidas>
maybe later I can write some additions to explain CAMLprim, CAMLlocal etc. so people won't need to repeat my mistakes
<wmeyer>
write a blog post :-)
<wmeyer>
we have a manual
<orbitz>
speaking of blog posts, anyone see the post on Hydra (not ocaml related). So jealous.
<wmeyer>
and sorry that I am proposing it, but yes we have a decent manual at the moment
<Leonidas>
or that, yeah. Should probably ask someone to proofread it.
<Leonidas>
wmeyer: well, the C part is kinda confusing :-/
<wmeyer>
maybe telling what I told you would just be enough ;-)
<Leonidas>
yes, maybe.
<wmeyer>
people that designed runtime are real experts on that matter, and they don't realise obvious topics
<orbitz>
Str has kind of a crappy interfaec if you write concurrent code
<osa1_>
I wish we have typerex for vim too :o
<wmeyer>
pippijn wrote re2ml some time ago
<osa1_>
anyone here using typerex ?
<wmeyer>
it was faster than anything else
<wmeyer>
but not sure if he is planning to release it
<wmeyer>
osa1_: I tried
<wmeyer>
and succeeded
<wmeyer>
but there many quirks
<osa1_>
wmeyer: what are you using now ?
ocp has quit [Quit: Leaving.]
<wmeyer>
Str if I need to, but in general ocamllex
<wmeyer>
osa1_: oh
<osa1_>
:)
<wmeyer>
tuareg
<wmeyer>
and caml-types
<osa1_>
wmeyer: is there a "plug and play" .emacs.d distribution for ocaml editing ? I don't really know emacs but I want to try a good OCaml IDE (I'm writing OCaml with vim full-time for 3,5 month now)
<bernardofpc>
and in both cases I find it very intriguing that people defending "how it's done" are unable to understand why people had their problem in the first place
<bernardofpc>
(nobody that's a begginer would think that open "just opens" and does not allow you to use whatever you just wanted to use...)
tootooroo has joined #ocaml
<Cypi>
Maybe the explanation is that "open" isn't a toplevel directive, whereas "#load" is.
<bernardofpc>
I couldn't care less... the toplevel should be able to modify in sensible ways the meaning of compiler directives
<bernardofpc>
it already does that with let a = 5 ;;
<bernardofpc>
(hum, lemme test)
<bernardofpc>
oh, interesting... let a = 5;; is valid in a .ml file
<Cypi>
Hmm, yes it is
<bernardofpc>
why does everybody use let .. in ?
<ousado>
if anything the toplevel does more than the compiler, but it certainly compiles
<ousado>
that's not such a HUGE difference
<bernardofpc>
ousado: do you know something that toplevel does more than just compiling ?
<thizanne>
bernardofpc: you probably use things like "let a = 5" in almost every .ml file you write
<Cypi>
bernardofpc : it just limits the visibility of local variables
<Cypi>
"let a = 5" is no different than "let f a b = a + b"
<bernardofpc>
Hum, syntax as ever...
<bernardofpc>
I did not understand that let a = 5 \n\n is the same thing as let a = 5 ;;
<Cypi>
" ;; " is just for the toplevel
<bernardofpc>
but the toplevel cannot know that, so you have to give it
<Cypi>
(and for Caml, but we're talking about OCaml, right? ^^ )
<bernardofpc>
In some sense, I still find it very strange that statements don't have an explicity boundary
<RWan>
Is the indentation important in Ocaml?
<bernardofpc>
RWan: no, thanks goodness
<bernardofpc>
it is probably important for readability, and most editors will help you
<bernardofpc>
but the compiler gracefully ignores them
<ousado>
there's an alternative syntax if you want the whitespace thing
<Cypi>
bernardofpc : the boundary isn't "\n" actually
<Cypi>
it's the "let" keyword
<Cypi>
You can write "let a = 4 let b = 5" in a .ml file
<bernardofpc>
of the *next* stataement
<bernardofpc>
I know
<bernardofpc>
(or sort of discovered that again today...)
<bernardofpc>
but this looks like some evil-master-mind plan to make a minimalistic syntax
<RWan>
Thanks! (thought I got an error because of indent, but I started a function with int instead of let, C habits...)
<bernardofpc>
RWan: ;-)
tootooroo has quit [Ping timeout: 276 seconds]
<bernardofpc>
(thinking out loud: lisp has () for delimiting statements, C has ; for terminating them, maple has ; and : according to the verbosity level
<Cypi>
"let" isn't so minimalistic, so.
<bernardofpc>
want to talk about if ?
<bernardofpc>
I think it was cc that never knew how it worked
<bernardofpc>
and I have another example from my own sufferings
<Cypi>
Whad do you mean? (about "if"?)
<bernardofpc>
I think he never knew where were its boundaries
mattrepl has quit [Quit: mattrepl]
<bernardofpc>
I mean, of course he knows where an if starts
<bernardofpc>
the problem is figuring out where the conditionnal ends, etc, etc
<Cypi>
(Oh, by "cc", you mean comp*nion_cube actually? ^^ )
<bernardofpc>
in a non-hl fashin
<bernardofpc>
anyway
<bernardofpc>
simple syntax question
<thizanne>
actually the if in OCaml works quite exactly as the if in C
<thizanne>
except you replace { } by begin end or ( )
<bernardofpc>
i have let f = function [] -> 42 | [x] -> function a -> a * x | x::s -> ...
<bernardofpc>
the second | is for which function ?
<thizanne>
I think it's for f
<bernardofpc>
(or even better: could I write a nested matching ?
<ousado>
thizanne: expr vs statement is an important distinction
<thizanne>
since you have to put begin ... end to write nested mtch
<Cypi>
thizanne : and what about "if false then v1 else v2 ; v3", too? :-°
<thizanne>
ousado: yes, I talked about the boundaries
<RWan>
let foo bar in tells "Replace all occurences of foo by bar", am I right?
<thizanne>
Cypi: I guess it's exactly the same in C
<thizanne>
it will become v2; v3
<Cypi>
Indeed, but I don't think it's so obvious in OCaml, because of the meaning of ";"
<thizanne>
it's obvious once you know it, I believe
<bernardofpc>
thizanne: in fact, I think I have to put begin..end even to write -> function ...
<Cypi>
bernardofpc : the second | is for the internal matching
<thizanne>
let f = function [] -> 42 | [x] -> begin function a -> a * x | x :: xs -> ... end
<Cypi>
indeed
<Cypi>
(or just parenthesis)
<Cypi>
But you can't write that anyway, "function ..." isn't an integer like 42 :-°
<bernardofpc>
yep
<bernardofpc>
but the idea was to have many functions on the RHS
<bernardofpc>
(different functions)
<bernardofpc>
at the end, I decided to give them names and put outside of f
<Cypi>
You could match the couple instead of one value, then the other (but I don't know at all the cost of this in term of performances)
<bernardofpc>
good question
<bernardofpc>
but I'm not anymore that much into asm-performance of OCaml
<Cypi>
:p
<bernardofpc>
I'll do what everybody does: wait for an optimizing inliner and assembler
<Leonidas>
thizanne: as I see you here, do you have any idea why so many ocaml-* packages got orphaned on AUR?
<ousado>
bernardofpc: is there something that makes you think ocaml doesn't produce optimized code?
<bernardofpc>
some asm I read in the past that shifts back and forth ints from OCaml to machine and vice-versa inside a function
<bernardofpc>
not having gcd + remainder in one single operation
<bernardofpc>
not being able to detect tail-recursion and compile it that way
<bernardofpc>
in particular, tree-tail-recursion with more than one branch, which is just horrible to write explicitly