<lispy`>
it's a bit limiting in that it only generates bytecode for example
<lispy`>
i tried to get some code to compile the other day that apparently wouldn't compile if i tried to compile to bytecode, I can only guess that there was a problem linking to one of the libraries
_fab has quit [Remote closed the connection]
<lispy`>
recompiled emacs and all is well
<sethk>
lispy`, I guess; it doesn't make sense that compiling to bytecode would fail when compile to native code succeeds
<sethk>
lispy`, so it had to be a link issue
<sethk>
lispy`, you mean emacs runs again?
<sethk>
lispy`, after rebuilding?
<lispy`>
ya
<lispy`>
port clean --all emacs ; port install emacs
<lispy`>
in haskell i can give a function a type signature separately from the file definition, is this possible in ocaml?
<lispy`>
er not file definition but function definition
<Smerdyakov>
Signatures and .mli files
<sethk>
lispy`, you can specify the signature
<sethk>
apart from the implementation
<sethk>
oh, sorry, Smerdyakov already answered
<lispy`>
okay, i'm not seeing the syntax what is it?
<Smerdyakov>
Read the manual on the module system.
<Smerdyakov>
The approach is fundamentally different from the way Haskell does it.
<sethk>
manual004, section 2.2
<sethk>
Smerdyakov, what's fundamentally different? There is at least one method that looks similar to me. What am I missing?
<lispy`>
oh, does ocaml-mode in emacs not do syntax highlighting?
<lispy`>
yeah, when i add "val foo : ..." on the line before the function definition i get a syntax error
<lispy`>
also, i see the examples define the compose function, is there a builtin operator for function composition?
<sethk>
lispy`, doesn't let f = g h work? that is, just naming the functions next to each other?
<lispy`>
sethk: no, i get type errors
<lispy`>
let foo x= true;;
<lispy`>
let bar (y:bool) = "hi";;
<lispy`>
let f = bar foo;;
<sethk>
lispy`, hm. I've done it with integer functions.
<lispy`>
oh
natv has quit ["Leaving"]
<lispy`>
i need to do foo bar
<lispy`>
but then i get the constant true
<lispy`>
instead of a function
<lispy`>
oh, right becasue foo can take anything
<sethk>
lispy`, I believe you can stop that by giving explicit types for the functions
<lispy`>
let f x = bar (foo x);; gives the expected function
<sethk>
lispy`, ah, good.
<sethk>
I'll have to figure out why. :)
<lispy`>
i'll just define (%) as compose, that's good enough for me
<lispy`>
so what is the normal way to convert a char to a string?
<lispy`>
using Printf.sprintf?
<sethk>
lispy`, there are other ways. I'll see if I can spot one. I suppose there is nothing wrong with using sprintf. I guess...
<lispy`>
it was the only way i could come up with on my own searching the documentation
<lispy`>
there is int_of_char and string_of_int but that's not what i want
<lispy`>
haskell's view of strings being a special case of lists can be very nice, so i was trying to write a string_of_charlist function, i'll just use sprintf for now :)
<sethk>
k
<beschmi>
lispy`: there is String.of_char in extlib
<beschmi>
there is also explode : string -> char list in there
<lispy`>
beschmi: hm....shouldn't "open extlib;;" open it for me then?
<lispy`>
that's not in darwin either, but maybe i should install it
<beschmi>
it's something like the ports system, but only for ocaml software
<lispy`>
yeah, it's annoying to have a separate system for each tihng, but i don't have a choice other than manual installation
<lispy`>
oh, i don't like the way godi installed
<lispy`>
/opt/godi/bin
<lispy`>
it shouldn't be in /opt/godi/bin
<beschmi>
you can configure that ./bootstrap --prefix ..
<lispy`>
yeah, but it really wasn't clear that it would put things in such weird places
<lispy`>
usually the default is pretty sane
<lispy`>
in fact, i can't install it to the normal place, it fails and says the directory exists
<lispy`>
it also tells me to look at a file which doesn't exist
<lispy`>
bootstrap.log
<lispy`>
at this point i wonder if i can trust it to behave correctly at all
<beschmi>
you can't install it to an existing directory (eg. /usr/local)
<lispy`>
which is really annoying
<lispy`>
i'm not going to put it in some obscure place and modify my path
<beschmi>
i use symlinks for the binaries, but i agree that it's not really optimal. but beats installing everything manually for me since my distribution never has all the ocaml libraries i need
<beschmi>
maybe someone should port cabal-get to ocaml
<lispy`>
so, extlib is installed, how do i get access to that function?
<lispy`>
that char_of function
<lispy`>
i tried open ExtLib.String;;
<lispy`>
but char_of is still unbound
<beschmi>
ExtString.String
<lispy`>
hmm....
<lispy`>
same error
<lispy`>
# ExtString.String.char_of;;
<lispy`>
Unbound value ExtString.String.char_of
<beschmi>
have you loaded extlib?
<lispy`>
i typed open ExtString;;
<lispy`>
and open ExtString.String;;
<beschmi>
that just opens the module, eg. you can use char_of instead of ExtString.String.char_of
<lispy`>
how do i load it?
<lispy`>
(from the toplevel)
<beschmi>
use #load "path/to/extLib.cma";;
<lispy`>
argh, i have to give the path?
<lispy`>
and the extension?
<beschmi>
if you have installed findlib, then you don't have to remember any paths and just use #require "extlib"
<lispy`>
i typed #load "extlib.cma" (hoping i wouldn'tneed the path), there was no error, but ExtString.String.char_of is stillunbound
<beschmi>
seems like you have to add the directory where extlib is installed with #directory too if you don't use findlib
<beschmi>
have to go now, bye
<monochrom>
Is it really called ExtString.String.char_of ?
<lispy`>
oh, it's of_char
<lispy`>
okay works now
<lispy`>
thanks for the sanity check
monochrom has quit ["good morning, sweet dream"]
y6cmE has joined #ocaml
mikeX has joined #ocaml
mikeX has quit ["Leaving"]
pango_ has joined #ocaml
pango has quit [Read error: 110 (Connection timed out)]
mflux has quit [Read error: 104 (Connection reset by peer)]
tom_p has joined #ocaml
mflux has joined #ocaml
vezenchio has joined #ocaml
<revision17_>
I've created a binary with ocamlopt on a sparc solaris 9 system; it has some C code linked into it (after strip, the file is 117KiB); should it run on any sparc solaris 9 system (IE are all required libs built in)?
Skal has joined #ocaml
<mflux>
I think it should, if it doesn't use for example gtk
<revision17_>
no, other than the base libraries (like Str and Unix), it has no dependencies
pango_ has quit [Remote closed the connection]
pango has joined #ocaml
<mflux>
try ;)
mlh has quit [Client Quit]
Revision17 has joined #ocaml
yozora has joined #ocaml
yozora has quit []
revision17_ has quit [Read error: 110 (Connection timed out)]
yozora has joined #ocaml
ski has joined #ocaml
ski_ has joined #ocaml
ski has quit [Nick collision from services.]
ski_ is now known as ski
Nate1975 has joined #ocaml
ski_ has joined #ocaml
ski has quit [Nick collision from services.]
ski_ is now known as ski
Nate1975 has quit ["using sirc version 2.211+KSIRC/1.3.11"]
__DL__ has joined #ocaml
ski_ has joined #ocaml
ski has quit [Nick collision from services.]
ski has joined #ocaml
ski_ has quit [Nick collision from services.]
ski has quit ["nmi"]
yozora has quit [Read error: 104 (Connection reset by peer)]
ski has joined #ocaml
y6cmE has quit [Read error: 110 (Connection timed out)]
Tachyon76 has joined #ocaml
ski_ has joined #ocaml
ski has quit [Nick collision from services.]
ski_ is now known as ski
chs_ has joined #ocaml
_fab has joined #ocaml
threeve has joined #ocaml
chs_ has quit []
mfurr has quit ["Client exiting"]
mfurr has joined #ocaml
ski has quit ["nmi"]
ski has joined #ocaml
Snark has joined #ocaml
mikeX has joined #ocaml
Tachyon76 has quit ["Leaving"]
_fab has quit [Read error: 113 (No route to host)]
mikeX has quit ["Leaving"]
Skal has quit [Read error: 60 (Operation timed out)]
mikeX has joined #ocaml
<mikeX>
how can one specify a chunk of code whose compilation is optional?
<mikeX>
as in an "ifdef ...somevar... <code> endif" in C
<pnou>
there's a camlp4 extension which does that
<mikeX>
pnou, I see.. thanks
<mikeX>
it appears one can even use the C preprocessor :D
mikeX has quit ["Leaving"]
<pnou>
for sure...
Skal has joined #ocaml
<Snark>
I do conditional compilation differently, using autoconf
<Snark>
I have a .ml.in with module FooImpl = @FOO_IMPL@
<Snark>
and compile either fooA.ml or fooB.ml depending on what FOO_IMPL is chosen
<Smerdyakov>
Is this conditional compilation where some code won't even compile under some conditions?
<Snark>
yes
<Snark>
I use FooImpl.generic_call
<Snark>
and since FooImpl is either FooA or FooB (and only one of them is compiled in), it works as long as they share the right interface
<Smerdyakov>
Relying on whole-program dead-code elimination is nice for cases when everything compiles fine.
<Snark>
the problem is not only dead-code elimination
<Smerdyakov>
In some cases, it is.
<Snark>
in my case some implementations use ocaml base calls or C-bindings
Msandin has joined #ocaml
shirogane has joined #ocaml
pango has quit ["Leaving"]
pango has joined #ocaml
chs_ has joined #ocaml
Schmurtz has joined #ocaml
ski has quit ["Zzz"]
mrsolo has joined #ocaml
smimou has joined #ocaml
shirogane has quit [Remote closed the connection]
cmeme has quit [Remote closed the connection]
Msandin has quit [Read error: 104 (Connection reset by peer)]
Snark has quit ["Leaving"]
_fab has joined #ocaml
vezenchio has quit ["Free Tibet with each Asian nation of a lesser or equal value"]
_fab has quit [Remote closed the connection]
monochrom has joined #ocaml
__DL__ has quit ["Bye Bye"]
mikeX has joined #ocaml
monochrom has quit [Read error: 110 (Connection timed out)]