<gaze__>
what's the preferred way to write recursive list generating functions when I don't want the function exposed by the api to have to take an empty list?
<sanguinev>
let exposed_func x y z =
<sanguinev>
let inner_func x1 y1 z1 =
<sanguinev>
...
<sanguinev>
in
<sanguinev>
inner_func x y z [];;
<sanguinev>
With recursive let and whatever else you need. ;)
onigiri has quit []
wsmith84 has joined #ocaml
<wsmith84>
flux / mrvn: to answer your question from before...
<wsmith84>
about tail recursion with only a cons as the last stmt
<wsmith84>
Tail recursion modulo cons is a generalization of tail recursion introduced by David H. D. Warren. As the name suggests, the only operation needed after the recursive call is a cons, which adds a new element to the front of the list that was returned. The optimization moves this operation inside the recursive call by creating a list node with the front element, and passing a reference to this node as an argument.
<wsmith84>
Voila.
aaronorosen1 has joined #ocaml
<aaronorosen1>
Hey I'm new to ocaml. I'm trying to figure out how I load my ocaml file into ocaml. I have a file with some functions that I wrote called test.caml. How to i get ocaml to read that file in so that i can use those functions?
kmkaplan has joined #ocaml
seafood has quit []
prime2 has joined #ocaml
aaronorosen has joined #ocaml
aaronorosen1 has quit [Read error: 54 (Connection reset by peer)]
xevz_ has joined #ocaml
seafood has joined #ocaml
xevz has quit [Read error: 110 (Connection timed out)]
xevz_ is now known as xevz
jdh30 has joined #ocaml
<jdh30>
anyone here committed code to the OCaml Forge?
jdh30 is now known as Guest66047
<thelema>
Guest66047 yes
<thelema>
I commit to the batteries project
<Guest66047>
i have a really dumb problem with it: cannot checkout the repo because I get "Permission denied (publickey)"
<Guest66047>
any idea why?
<Guest66047>
i googled it and made some tweaks but no joy
<Guest66047>
I'm trying to upload HLVM. :-)
<thelema>
git?
<thelema>
can you ssh to git.ocamlcore.org?
<Guest66047>
svn
<thelema>
your uploading account should have shell access (enough to test that ssh works)
<Guest66047>
i tried ssh to svn.forge.ocamlcore.org from here and it fails with the same error
<Guest66047>
Could this be because my new project has not gone through their system yet?
<thelema>
okay, so now you need to fix your keypair. You've generated a keypair and uploaded the public half to the server?
<thelema>
s/uploaded/submitted/
<Guest66047>
no
<Guest66047>
:-)
<thelema>
it could be because whatever script that accepts that data doesn't ...
<Guest66047>
where is that described?
<thelema>
ah, you'll have to do that - I think they only do public key authentication.
<Guest66047>
btw, I got an important looking e-mail in French from the Forge.
<Guest66047>
ok
<Guest66047>
i generated a key pair. How do you submit it?
<thelema>
there is a cron job that updates the authorized_keys file, so give up to hour for it to work
<thelema>
(of course you can read)
ched_ has joined #ocaml
<Guest66047>
lovely. i think i'm all done. I'll just work on earning some money and get back to trying it. Thanks for all the help.
<thelema>
you're welcome, jon
Ched has quit [Read error: 110 (Connection timed out)]
<Guest66047>
Incidentally, if anyone here is interested in the HLVM project (and I've love people to take a look once its uploaded) please join the hlvm mailing list.
<thelema>
Guest66047: there's only hlvm-commits - will conversation take place there?
<Guest66047>
I've no idea.
<Guest66047>
:-)
<Guest66047>
Ok, I just added the ingeniously titled "hlvm-list" where you can discuss "anything and everything about the HLVM project". ;-)
<thelema>
ok. If there's not a lot of commits, it may not be too bad to use that...
<thelema>
but a separate one seems good to me.
<Guest66047>
No, we'll use the other one. I'd like to keep them separate.
<Guest66047>
yeah
<Guest66047>
i have really high hopes for this project...
<thelema>
ok. It doesn't seem to be activated yet, I'll try back in some minutes
prime2 has quit [Remote closed the connection]
alexyk has joined #ocaml
Guest66047 has left #ocaml []
alexyk has quit []
aaronorosen has quit [Remote closed the connection]
angerman has joined #ocaml
jeremiah has quit [Read error: 104 (Connection reset by peer)]
alexyk has joined #ocaml
jeremiah has joined #ocaml
jeremiah has quit [Read error: 104 (Connection reset by peer)]
seafood has quit []
jeremiah has joined #ocaml
wsmith84 has quit ["Leaving"]
wsmith84 has joined #ocaml
jeremiah has quit [Read error: 104 (Connection reset by peer)]
jeremiah has joined #ocaml
verte has quit [Read error: 60 (Operation timed out)]
angerman has quit []
verte has joined #ocaml
jeremiah has quit [Read error: 104 (Connection reset by peer)]
jeremiah has joined #ocaml
jeremiah has quit [Read error: 104 (Connection reset by peer)]
schme has joined #ocaml
coastermaster has joined #ocaml
jeremiah has joined #ocaml
Stefan_vK1 has joined #ocaml
seafood has joined #ocaml
seafood has left #ocaml []
jlouis_ has joined #ocaml
wsmith84 has quit [Read error: 110 (Connection timed out)]
jlouis has quit [Read error: 104 (Connection reset by peer)]
seafood has joined #ocaml
alexyk has quit []
alexyk has joined #ocaml
Stefan_vK has quit [Read error: 110 (Connection timed out)]
jeremiah has quit [Read error: 104 (Connection reset by peer)]
lintrippz has quit [Remote closed the connection]
sbok_ has joined #ocaml
sbok has quit [Read error: 113 (No route to host)]
jeremiah has joined #ocaml
alexyk has quit []
alexyk has joined #ocaml
angerman has joined #ocaml
Snark has joined #ocaml
itewsh has joined #ocaml
alexyk has quit []
angerman has quit []
coastermaster has quit []
_zack has joined #ocaml
Camarade_Tux has joined #ocaml
ttamttam has joined #ocaml
itewsh has quit [Read error: 110 (Connection timed out)]
itewsh has joined #ocaml
janshei has joined #ocaml
janshei has quit [Client Quit]
chickenzilla has joined #ocaml
chickenzilla has quit [Client Quit]
chickenzilla has joined #ocaml
Alpounet has joined #ocaml
chickenzilla` has joined #ocaml
arquebus has joined #ocaml
<mrvn>
What is hlvm?
<Alpounet>
a toolkit for developing virtual machines for dynamic languages
<mfp>
heh pa_utf8 to escape chars in literals from a UTF-8 source file (so "€" in UTF-8 becomes uc"\342\202\254" or such)
<mfp>
yes, octal
<thelema>
rwmjones_: yes, the whole problem comes down to misunderstanding "based on joint work he did with me" to mean "you can take that part of what we wrote and make a book out of it.
<mfp>
bad ex, should have been uc"\226\130\172"
<thelema>
mfp: grr, I wonder if we can fix that in batteries... sadly, I think we'd break backwards compatibility, but there's no reason to default to octal escapes.
<mfp>
thelema: it was just a c/p error, OCaml does use decimal
<mfp>
or hex with \xAB
authentic has quit [Read error: 60 (Operation timed out)]
^authentic has joined #ocaml
^authentic is now known as authentic
* thelema
relaxes - octal looks like decimal but isn't. *dangerous*
<Yoric[DT]>
:)
<thelema>
Yoric[DT]: how's the .dist to .mli coming
<Yoric[DT]>
Slowly.
<Yoric[DT]>
I'm currently putting together the skeletton.
<Yoric[DT]>
But the .mli parsing part is going to be a good time to bang my head on the walls.
<thelema>
yes, that'll be less fun than desired
<thelema>
maybe it'll be sufficient to count ... ick. sig ... end -- you'll have to count levels for everything that ends with [end]
<Yoric[DT]>
and which doesn't happen in a comment
<Yoric[DT]>
and without the help of lex, yacc, Genlex, stream parsers, etc.
<thelema>
wait, it's mli. they don't have any of that stuff.
<Yoric[DT]>
What stuff?
<thelema>
what about /^\s{2*indent_level}end$/
* Yoric[DT]
doesn't understand what you mean.
<thelema>
the other stuff that ends in [end] -- begin..end, struct..end
<Yoric[DT]>
Ah, ok.
<thelema>
the stuff you're mentioning, they do have, sorry...
<Yoric[DT]>
Yeah, there's only sig..end. And comments :/
<thelema>
so require an indent of 2 spaces per nesting level, so if you want to find the [end] for a toplevel module inside foo.ml (ex: Foo.Bar), just find the first [end] with 0 spaces before it (after [module Bar], of course)
<Yoric[DT]>
Too fragile for my tastes.
<thelema>
and for Foo.Bar.Baz, the first [end] with 2 spaces before it (or whatever specific whitespace will come.
<thelema>
okay, how about requiring: [end (* Bar *)] -- comment tags on the end of the module
<thelema>
some languages encourage this for code clarity anyway.
<Yoric[DT]>
Mmmmh....
<Yoric[DT]>
That's a good idea.
<thelema>
when faced wih a hard problem and not the right tools to solve the problem... redefine the problem.
alexyk has joined #ocaml
ulfdoz has quit [Read error: 104 (Connection reset by peer)]
rwmjones__ is now known as rwmjones
ulfdoz has joined #ocaml
mfp_ has joined #ocaml
jeremiah has quit [Read error: 104 (Connection reset by peer)]
<Yoric[DT]>
Well, I believe that the skeleton is complete.
<Yoric[DT]>
Now, on to implementing all the functions...
wsmith84 has joined #ocaml
mfp has quit [Read error: 104 (Connection reset by peer)]
<thelema>
Yoric[DT]: yay top-down programming
<Yoric[DT]>
:)
<wsmith84>
'morning
<wsmith84>
Just wondering this morning, if there is a yearly OCaml users conference somewhere?
<wsmith84>
(Google doesn't yield a website, but there is mention of one on CWN.)
<Yoric[DT]>
There's a OCaml users meeting.
<wsmith84>
Where/when?
<Yoric[DT]>
Not quite a conference (i.e. no papers).
<Yoric[DT]>
Last month.
<Yoric[DT]>
This year, it was in Grenoble, France.
<Yoric[DT]>
Last year, it was in Paris, France.
<Yoric[DT]>
(and that was the first such meeting)
<wsmith84>
Do you have a website? How many persons attend?
<thelema>
hmm, apply3... is for functions wit 3 args, no?
<thelema>
you're using callbackN with 5 ...
<mrvn>
I'm assuming it is first applying 3 and then the remaining 2.
jeremiah has joined #ocaml
jeremiah has quit [Connection reset by peer]
wsmith84 has joined #ocaml
prime2 has joined #ocaml
imajes has joined #ocaml
jeremiah has joined #ocaml
authentic has quit [Read error: 60 (Operation timed out)]
imajes is now known as authentic
itewsh has joined #ocaml
jeremiah has quit [Connection reset by peer]
vuln has joined #ocaml
imajes has joined #ocaml
_zack has quit ["Leaving."]
jeremiah has joined #ocaml
authentic has quit [Read error: 113 (No route to host)]
imajes is now known as authentic
alexyk has joined #ocaml
jeremiah has quit [Read error: 104 (Connection reset by peer)]
coastermaster has quit []
Amorphous has quit [Connection timed out]
Amorphous has joined #ocaml
love-pingoo has joined #ocaml
jeremiah has joined #ocaml
sitaktif has quit [calvino.freenode.net irc.freenode.net]
petchema has quit [calvino.freenode.net irc.freenode.net]
caligula__ has quit [calvino.freenode.net irc.freenode.net]
TaXules has quit [calvino.freenode.net irc.freenode.net]
svenl_ has quit [calvino.freenode.net irc.freenode.net]
caligula__ has joined #ocaml
svenl_ has joined #ocaml
sitaktif has joined #ocaml
petchema has joined #ocaml
TaXules has joined #ocaml
vuln has quit ["leaving"]
<mrvn>
Args. I found the bug. I didn't even set the callback and the detection that it is unset is broken.
<kmkaplan>
Is there any easy way to work on IPv4 and IPv6 addresses?
rwmjones is now known as rwmjones_afk
arquebus has joined #ocaml
vuln has joined #ocaml
<vuln>
Hello there. Why the toptool keeps waiting for something when I try to create a variable with a name started by #? (I know it's invalid constructor, but I would like to know it keeps waiting instead of give me a warning)
<vuln>
why it keeps*
<mrvn>
kmkaplan: Unix module?
<mrvn>
vuln: no ;; to start evaluation?
Snark has quit ["Ex-Chat"]
prime2 has quit [Read error: 60 (Operation timed out)]
<kmkaplan>
I looked in it and some things are usefule. But I want to transform a IPv4 address to IPv4-mapped IPv6 address.
<vuln>
mrvn: I wrote ;; :)
<vuln>
no, I didn't
<vuln>
god sake kkk
<kmkaplan>
And also check if an IPv6 address is a IPv4-mapped address.
<mrvn>
# let #foo = 17;;
<mrvn>
Error: Unbound type constructor foo
<vuln>
Thanks mrvn. I can't believe I forgot it.. I was testing more than 20 ways of name a variable, and I forgot the ;; exactly at this one
alexyk has quit []
<vuln>
Thank you and sorry
alexyk has joined #ocaml
ggole has joined #ocaml
<kmkaplan>
Is it possible to get the address as a raw Int32 or big_int?
alexyk has quit [Client Quit]
<ggole>
Hi. Is there any way to persuade ocamlc to use stdin and stdout instead of filenames? I'm trying to use the output of ocamlc -dtypes and piping the data around would be more convenient.
<kmkaplan>
ggole: outputing to /proc/self/fd/1 does not work ?
<ggole>
Dunno, I'll try that.
<love-pingoo>
there's also /dev/stdout
<ggole>
ocamlc doesn't seem to like those, since they don't end with .ml
<ggole>
The filename magic is useful most of the time, but I think it's going to sink me on this
<ggole>
Oh wait, -impl
<ggole>
Brilliant
<kmkaplan>
Mmm, if it's only a file naming problem you could try adding symlinks to them.
<ggole>
-impl and /dev/stdin does the job. Thanks.
Camarade_Tux has joined #ocaml
schme is now known as schmx
gaze__ has joined #ocaml
wsmith84 has quit [Read error: 110 (Connection timed out)]
alexyk has joined #ocaml
vuln has quit ["leaving"]
rwmjones_afk is now known as rwmjones
smimou has quit [Read error: 110 (Connection timed out)]
jedai has quit [Read error: 110 (Connection timed out)]
smimou has joined #ocaml
Mr_Awesome has quit [Read error: 110 (Connection timed out)]
chickenzilla` has joined #ocaml
chickenzilla has quit [Nick collision from services.]
chickenzilla` is now known as chickenzilla
arquebus has left #ocaml []
_zack has joined #ocaml
alexyk has quit []
seafood has joined #ocaml
<Yoric[DT]>
thelema: after checking, it seems that I can't use Str in myocamlbuild.ml ...
* Yoric[DT]
now knows why he didn't address that bug earlier.
<Yoric[DT]>
It's messy.
<thelema>
:(
<thelema>
so we just need some code to do global string replacement? I can work on that.
<Yoric[DT]>
Well, if you could write this, that would save me a few implementation headaches and let me concentrate on, well, other implementation headaches :)
* thelema
will do this.
dartelin has joined #ocaml
<dartelin>
hello
<dartelin>
i'm new to ocaml, so my question may be noobish, but here's my problem
<dartelin>
let sumOfLengths listOfLists = List.length (List.hd listOfLists);;
<Yoric[DT]>
Ah, I believe I understand your problem.
<ggole>
dartelin: evaluate phrase is probably only grabbing the first part of that
<Yoric[DT]>
"Evaluate phrase" only evaluates until the first ;;
<Yoric[DT]>
So sumOfLengths [[1; 2; 3]; [1; 2]; [1]];; is another phrase.
<Yoric[DT]>
You have to do Evaluate phrase again to execute it.
<dartelin>
sure
<dartelin>
i get it now
<dartelin>
i have to select the phrase
<dartelin>
and then evaluate
<dartelin>
me is stupid
<Yoric[DT]>
(and, as suggested by ggole, although with the wrong keys, you should do it with the keyboard, it's faster)
<dartelin>
yes, but tell me one thing
<Yoric[DT]>
C-c C-e to evaluate phrase
<ggole>
You could also send the whole buffer, but that's usually overkill
<dartelin>
which one is the Meta-key ?
<Yoric[DT]>
(C is "control")
<ggole>
Usually alt
<Yoric[DT]>
Typically, the Windows key.
<Yoric[DT]>
Arf, depends on your keyboard :)
<schmx>
BAH!
<schmx>
Left foot pedal.
<ggole>
Well, meta as intepreted by emacs is usually alt
<Yoric[DT]>
(usually not the same for laptops and desktops anyway)
* schmx
goes back to idle.
<Yoric[DT]>
:)
<dartelin>
clrl+alt worked
<dartelin>
thanks for your help
<ggole>
schmx: every now an then I think about getting one of those
<ggole>
Tell me, are they worthwhile?
<Yoric[DT]>
Our pleasure.
<schmx>
ggole: I think it's very hmm... how one says. different from person to person. I very much like 'em (:
<ggole>
Hmm
<ggole>
I should try one
<ggole>
I type enough :)
<schmx>
I recommend the whole kinesis setup with the 3 foot pedals and fancy keyboard.
<schmx>
But I dunno.. They're only useful if one sits in a "correct" posture while hacking/typing. (:
* schmx
goes back to idle again :P
<Yoric[DT]>
Gasp, a new compilation problem has appeared.
<Yoric[DT]>
Mmmmhh...
* Camarade_Tux
wouldn't be able to use both his hands and feet at the same time ><
<dartelin>
ok, this code works for me but i don't think it's the optimal solution: # let sumOfLengths listOfLists = List.length (List.hd listOfLists);;
<dartelin>
val sumOfLengths : 'a list list -> int = <fun>
<dartelin>
# can anyone tell me how to do it better ?
<dartelin>
wait, wrong code
<dartelin>
let rec sumOfLengths listOfLists = List.length (List.hd listOfLists) + if(List.length listOfLists) > 1 then sumOfLengths (List.tl listOfLists) else 0;;
<Camarade_Tux>
dartelin, do you know the 'match ... with' construct ?
<ggole>
dartelin: you should probably use pattern matching instead of calls to List.hd
smimou has quit [Read error: 110 (Connection timed out)]
* Yoric[DT]
concurs.
<ggole>
dartelin: are you working from a text?
<dartelin>
Camarade_Tux, not yet
<dartelin>
ggole, what do you mean text ?
<ggole>
From a document or book that describes ocaml
<dartelin>
yes, i have a tutorial
<ggole>
I see. I won't try to second guess it.
<dartelin>
but i try to find a solution based on my knowlege about other languages
<dartelin>
imperative
<dartelin>
like iterating through a list
<ggole>
Imperative code is occasionally the right thing, but not in this case imho
<ggole>
But follow your tutorial.
hkBst has quit [Read error: 104 (Connection reset by peer)]
<Yoric[DT]>
In that case, you will rather "fold" through the list rather than "iterate" through it, although it's the same general idea.