<pango>
because that looks like *sh errors... as if the wrong interpreter was used
<dark_light>
ocaml test works
<dark_light>
:(.
<pango>
un*x line returns ?
<dark_light>
un*x line?
<dark_light>
when i type ocaml test, it's working, if you meant ask it :P
Smerdyakov has quit ["reboot"]
<pango>
I mean, lines ended with \r alone ?
<dark_light>
well, i think yes.. i am using pico/nano
<dark_light>
it saves files with the unix standard
<dark_light>
my 'Programming concepts and techniques' professor said he will use objective caml. he said 'i will not recommend any book. this site is useful: http://caml.inria.fr/ ' .. note that I am brazillian, hehe. :)
<dark_light>
seems to be a hard language =~
<pango>
when I download your post from pastebin, emacs says DOS endlines... could it be pastebin ?
<dark_light>
maybe yes..
<dark_light>
internet html files aren't very unix compliant
<pango>
anyway, if it was a problem of endlines, the message would have been different...
<dark_light>
yeah..=~
<pango>
$ ./567901.ml
<pango>
: bad interpreter: No such file or directory
<pango>
because the first character of the DOS endlines are seen by the kernel, so it's looking for /usr/bin/ocaml^M interpreter
<dark_light>
well, when i change /usr/bin/ocaml to /bin/bash, i get another error
Smerdyakov has joined #ocaml
<pango>
$ ./test.ml
<pango>
Hello world!
<dark_light>
pango, can you send this file with dcc?
<pango>
trying...
<dark_light>
failed:)
<dark_light>
well..
<mikeX_>
can't you just write it?
<pango>
usual ;)
<mikeX_>
you could also use 'recode'
<dark_light>
recode?
<dark_light>
mikeX_, i wrote, but the interpreter said it has errors
<pango_>
to get back to ocaml, ignore(print_endline "Hello world!") would have worked too
ski_ has joined #ocaml
<pango_>
not to mention print_endline "Hello world!" ;)
<mikeX>
:)
ski has quit [Nick collision from services.]
ski_ is now known as ski
<pango_>
personally, I used several sources to learn ocaml, but I found "developing applications with objective caml" to be quite good... http://caml.inria.fr/pub/docs/oreilly-book/
<dark_light>
pango_, its the same book of aptitude install ocaml-book-en ?
<pango_>
yes, I think so, it's the o'reilly book
<dark_light>
o'reilly is the creator? humm
<dark_light>
pango_, ocaml-tutorial.org is what i was reading=p
<pango_>
no, o'reilly is the publisher
<mikeX>
I find that book very useful as well
<mikeX>
I'm mostly looking at that, and the reference manual
* mikeX
is still learning :)
<pango_>
still learning too... I've yet to use objects, for example ;)
pango has quit [Read error: 110 (Connection timed out)]
<dark_light>
730 pages.. it's not very nice to print on home. ahm.
<mikeX>
hehe
<pango_>
oh, I see where "repeated" comes from now ;) Well, it's just an example, it's not a standard function of ocaml
bohanlon has joined #ocaml
<dark_light>
yeah:)
khaladan has quit [Read error: 104 (Connection reset by peer)]
perspectivet has joined #ocaml
Smerdyakov has quit ["Leaving"]
mikeX has quit ["zzz"]
sabetts has joined #ocaml
<sabetts>
this place looks alive
<perspectivet>
no it's not.
<perspectivet>
unfortunately.
rcy has joined #ocaml
<pango_>
ymmv... depending on timezone, for example
mrsolo_ has quit [Read error: 104 (Connection reset by peer)]
mrsolo_ has joined #ocaml
dark_light has quit [Remote closed the connection]
vodka-goo has joined #ocaml
pango_ has quit ["Client exiting"]
pango has joined #ocaml
_fab has joined #ocaml
revision17_ has joined #ocaml
Revision17 has quit [Read error: 110 (Connection timed out)]
rillig has joined #ocaml
pwned has joined #ocaml
slipstream-- has joined #ocaml
slipstream has quit [Read error: 110 (Connection timed out)]
pwned has quit [Read error: 104 (Connection reset by peer)]
pwned has joined #ocaml
pwned_ has joined #ocaml
bohanlon has quit ["Leaving"]
pwned has quit [Read error: 110 (Connection timed out)]
pwned_ is now known as pwned
rillig has quit [Remote closed the connection]
joshcryer has quit [Success]
<ulfdoz>
A question about design: How would you distribute command line arguments to the relevant places? One solution would be, to instantiate an object carrying the configuration and let the relevant parts of the program decide what to do. Another solution would be to construct the controll flow with branches appropriately. Are there other options?
rcy has left #ocaml []
<vodka-goo>
Looks like a too general question..
<vodka-goo>
maybe it'd help to explain better what your second option is
<vodka-goo>
I'm not sure to understand
<vodka-goo>
it depends a lot on how modular your program is.. for example mplayer has a -lavcopts blabla option, which I guess causes blabla to be sent to lavc plugin
<ulfdoz>
By branches I mean things like: if arg[i] = "-h" then print_help else if arg[i] = "-g" then ....;;
mikeX has joined #ocaml
<ulfdoz>
But I don
<ulfdoz>
't think, that its general enough and well to extend.
<mikeX>
hmm, what's the syntax for putting funtions into record types?
<vodka-goo>
ulfdoz: just want to check.. you know the standard module Arg ?
<vodka-goo>
mikeX: type t = { f : int -> int } ;; { f = (fun x -> x) } ;; ?*
<mikeX>
vodka-goo: thanks, I couldn't remeber and used all sort of weird combinations
<ulfdoz>
vodka-goo: I read the documentation, but as I'm not an expert in ocaml, i think about doing the things by hand, just for learning it.
<vodka-goo>
ulfdoz: at first I thought you were looking for something more high level than Arg.. do it by hand if you want, but Arg is something good to know
chimikal_ is now known as chimikal
<ulfdoz>
vodka-goo: Main problem is, how to pass around information from the command line arguments in a tidy (preferably functional) way.
<vodka-goo>
here is a item of the list I pass to Arg
<vodka-goo>
["-d";"--daemon"],
<vodka-goo>
Arg.Unit (fun f -> Conf.set_bool "daemon" true),
<vodka-goo>
"Run in daemon mode" ;
<vodka-goo>
you should really take a look at that module
<vodka-goo>
["-m";"--load-module"],
<vodka-goo>
Arg.String Dynliq.load,
<vodka-goo>
"Load a bytecode plugin."
<vodka-goo>
(in that one Dynliq.load : string -> unit)
<vodka-goo>
yet it is not purely functional and I typically do side effects a lot there
<mikeX>
I thought Arg. only accepted single Keys
<mikeX>
not lists of Keys
<ulfdoz>
looks, like your are using a map "Conf" for passing configuration around?
<vodka-goo>
mikeX: you're right I'm expanding the multiple keys before giving the list to Arg
<mikeX>
thought savonet was not actively maintained
<vodka-goo>
héhé
<vodka-goo>
<ad>It is actively maintained and works better than ever !</ad>
<vodka-goo>
(though not as well as I'd like..)
<mikeX>
glad to here that, I still haven't tried it, but I'm looking forward to :)
<vodka-goo>
mikeX: liquidsoap is definitely worth a look if you're interested in audio streaming
<vodka-goo>
(other subprojects like strider for audio indexing are far behind, unfortunately)
<mikeX>
I hope to setup a streaming server once I have some time
Smerdyakov has joined #ocaml
<vodka-goo>
mikeX: what kind of content do you plan to stream ? /me curious
<mikeX>
not sure yet, it's mostly for 'done that too'
<vodka-goo>
OK
<mikeX>
:)
<vodka-goo>
I'm actually wondering what the people do about audio streaming..
<vodka-goo>
mostly student radios in campus
<mikeX>
hehe,
<vodka-goo>
I've heard of a theater radio, too
<vodka-goo>
I'd like to find some radio streaming music from some free netlabels
<mikeX>
hmm, we have a pirate radio station on my campus which also streams content, but mostly underground greek punk music
<vodka-goo>
savonet was done for a pirate campus radio too :p and not everybody liked our music, too :)
<mikeX>
hehehe
<vodka-goo>
the school is too small anyway and it's currently dying.. it's urgent that liquidsoap gets new radios (radiopi.org is the only one we know of, but two others may appear)
<mikeX>
unfortunately, despite the nature of the streamed content, that radio still uses proprietary software for most things :(
<mikeX>
radiopi seems nice :)
<vodka-goo>
they're under reconstruction, but they do have a lot of potential (huge school)
<vodka-goo>
they used to have ten channels and many live shows per week, regularly
<vodka-goo>
they crashed a server at beginning of year, now rebuilding on top of liquidsoap, and rebuilding a website too
<vodka-goo>
since it only partially works, new students weren't impressed and didn't involve
joshcryer has joined #ocaml
<mikeX>
too bad
<vodka-goo>
they'll get better, I trust them
<mikeX>
heh
slipstream-- has quit [Read error: 104 (Connection reset by peer)]
rillig has joined #ocaml
_fab has quit []
pwned has quit [Remote closed the connection]
slipstream has joined #ocaml
Schmurtz has quit [Read error: 113 (No route to host)]
bluestorm has joined #ocaml
zooko has joined #ocaml
slipstream has quit [Read error: 104 (Connection reset by peer)]
slipstream has joined #ocaml
pango has quit ["Leaving"]
pango has joined #ocaml
schlick has joined #ocaml
<schlick>
Wanted to check my understanding of ML at this point. As far as language concepts outside the norm of imperative or functional languages, there is pattern matching and checking of custom types from what I can tell. Anything else?
<vodka-goo>
mmm difficult to be exhaustive
<ski>
modules
<vodka-goo>
what's custom types ?
<vodka-goo>
objects, and (my current favourite) labels
<ski>
user-defined, i imagine
<schlick>
Most languages just have base types. By "custom types" I mean "datatype <your stuff here>" gets checked, which is decidedly out of the ordinary.
mikeX_ has joined #ocaml
<vodka-goo>
even C has kind of that
<vodka-goo>
when you define structures or enum/unions
<schlick>
typedef just seems to obfuscate things by giving them a different name rather than the standard declaration. It doesn't seem to add any further checking ability.
<vodka-goo>
it's just much less flexible and meaningful
<schlick>
I suppose. I don't even consider a structure or union to be anything like type checking. It's more like a data structure to me.
<vodka-goo>
schlick: when you do type x = blalba where blabla isn't a sum or record definition, you're just giving a different name to something
<vodka-goo>
for example type t = int * int, you can never tell int*int from t
<fluxx>
the funny thing is that the compiler still keeps track
<fluxx>
so if you compile with -dtypes and run emacs, you can go to an expression and it can differentiate between int * int and t
<schlick>
If I define a data type to be one of two things, it will assure it is only one of those two things.
<vodka-goo>
schlick: if you force a to be t, it will still be usable in a int*int slot
<fluxx>
so your function let foo bar : 'a -> t = fun _ -> (4, 3) will return t..
<schlick>
I guess. I do know that in C I can't say "this will have the value of 1 5 or 9" and have the compiler check it.
<fluxx>
that can be useful sometimes
<vodka-goo>
fluxx: yes
<vodka-goo>
but sometimes, the compiler looses track (can't read in your mind)
<vodka-goo>
schlick: sum types should exist in every language
<vodka-goo>
modern "dynamic" languages keep not having it, that's a shame !
mikeX has quit [Read error: 110 (Connection timed out)]
<fluxx>
schlick, well, there is enum.. but it isn't very strictly enforced :) (what is)
<fluxx>
vodka-goo, well, in dynamic languages you can assign anything to anything..
<vodka-goo>
true.. I guess it isn't really compatible
<schlick>
Anyway, as far as I know objects and modules are not unique to ML.
<schlick>
Lables I have not heard of in the context of ML, and I have gone through several tutorials. Lables usually mean something for goto to use, to me.
<schlick>
No idea what they mean here.
<vodka-goo>
My thought is actually that the "dynamic" languages aren't useful because of dynamicity, and THEY SHOULD ALL BE STATICALLY CHECKED ! (crazy evil laugh)
<fluxx>
not maybe unique, but ocaml's implementation of objects is interesting, and a similar module system isn't that common either
<vodka-goo>
schlick: it's for naming arguments of a function
<vodka-goo>
it allows optional args
<fluxx>
hardware description languages (or atleast vhdl) have a similar module system
<vodka-goo>
and removes constraints on the order of params
<fluxx>
ocaml's labeled parameter system is the nicest one I've seen
<fluxx>
I haven't seen many, though :)
<vodka-goo>
there is a nice consistent theory of lambda calculus with labels, it's much better than optional labeled args in python/perl/..
<fluxx>
but the beaty of passing ?arguments just works..
<fluxx>
s/ just/, it&/
<schlick>
Hmm, not sure I would consider the ability to give arguments out of a fixed order to be a good thing, but at least I know what you're talking about now.
<bluestorm>
hum
<vodka-goo>
schlick: take a look at GTK bindings
<fluxx>
it you happen to need a function that needs to take, say, 5 parameters, it is not a bad idea to give some names
<vodka-goo>
there can be 10 args to a function
<bluestorm>
label allow some semantic information when calling a function
<vodka-goo>
naming them is much more meaningful than enforcing the order
<bluestorm>
:)
<vodka-goo>
(and giving default values for optional params makes it so much easier)
<mikeX_>
indeed labels fit really nice into lablgtk
<schlick>
I agree with naming arguments. It'd be nice if it was mandatory in C/C++. I just don't like the idea of much variability in language syntax.
<mikeX_>
as well as closures
<schlick>
allowing me to rearrange the arguments to a function sounds like just a new way to make my code messier to me.
<fluxx>
it also allows currying any argument
<vodka-goo>
schlick: I find it often more readable with labels
<fluxx>
(doing that to any two arguments in any order will still require a lambda function, though)
<bluestorm>
and fluxx is right, currying possibilities are great
<schlick>
I knew about closures I just didn't realize everything that could be done with them till recently.
<schlick>
I think they're fairly standard in functional languages.
<vodka-goo>
yup
<bluestorm>
fluxx, what is so interesting in ocaml object model ?
<schlick>
I'm having some trouble wrapping my head around ML's equivalent to a "struct" because from what I've seen in the tutorials the name of the structure doesn't appear anywhere. Having function declaration (at least optionally) look like variable declaration gave me a headache too.
<schlick>
I'll probably get over that.
<bluestorm>
hum schlick
<fluxx>
bluestorm, well, it's different, from c++/java ;)
<bluestorm>
look for "record"
<fluxx>
bluestorm, that you just provide an interface with certain methods, there is no actual hierarchy
<fluxx>
I don't like that you need to explicitly downcast, though :/
<schlick>
From trying to read up on type theory, I can sort of understand the english part of what they're saying, but the symbolic part is very hard to follow. I've managed to dredge up what most of the symbols mean.
<schlick>
However there's this thing that looks like a capitol T with part of the top left bar lopped off.
<schlick>
I've read that it means "context"
<fluxx>
you can also write new objects with a set of methods in an expression, no need for a separate declaration (although I haven't given this feature much (any?-)) use)
<schlick>
Can someone explain that a bit better? The word "context" is the only defintion I've seen.
<vodka-goo>
objects are fairly light to use, I agree -- and I also prefer prototype based objects to class based
Godeke has quit ["Leaving"]
<vodka-goo>
schlick: i don't think reading the reference about objects helps
<vodka-goo>
it's way too obscure, I was surprised by that
<vodka-goo>
.. on the other hand I don't know any good link
<schlick>
I'm not reading the reference about objects.
<bluestorm>
i learned ocaml objects in a french book
<schlick>
Anything on type theory has these little notations in natural deduction.
<schlick>
With wikipedia and google I managed to figure out what most of the symbols mean.
<bluestorm>
(it was my first object-oriented language and i understood a little, so this may be a good document)
<schlick>
However I have yet to see even the name of the T with the top left bar lopped off mid way.
<schlick>
And I have no idea what it means.
<vodka-goo>
url ?
<schlick>
Look up "Natural Deduction" in wikipedia to see several.
<schlick>
It doesn't define what it means there either.
<schlick>
I've got the Math Symbols and Logic Symbols pages from Wikipedia and some other random stuff from google, which explain most of the rest, but not that particular symbol.
<vodka-goo>
¬ is a negation
<vodka-goo>
is that what you needed ?
<schlick>
vodka-goo that's not the symbol.
<schlick>
It's a T with the top left bar lopped off, like you see at the top left of nearly every statement in Natural Deduction.
<schlick>
part of the top left bar...
<vodka-goo>
sorry I don't understand "lopped" :) is that ⊢ ?
<schlick>
There's still a little prong left.
<schlick>
No, it's not the turnstile.
<vodka-goo>
Γ ?
<schlick>
Draw T on a sheet of paper.
<schlick>
Now erase half the top left bar.
<schlick>
That's it.
<vodka-goo>
Γ is just a capital gamma
<vodka-goo>
usual variable for contexts
<schlick>
No, it has a prong on the left.
<vodka-goo>
prong ?
<vodka-goo>
can you paste something ?
<schlick>
Why not look at the Natural Deduction page on Wikipedia?
<vodka-goo>
i'm there
<vodka-goo>
I've gone through the page, and all I saw was negations, turnstiles and Gammas
<schlick>
You don't see a whole bunch of stuff in dashed boxes, of which the top left character inside the box is a T looking thing with half the top left bar erased?
<vodka-goo>
that's an unusual challenge :)
<vodka-goo>
no I don't think so
<schlick>
Ok, search for "substitution theorem" if you get the right one, it should be in bold.
<schlick>
Scroll down to the first set of dashed boxes below that
<schlick>
In the leftmost dashed box, the first character (the one in the top-left corner) looks like the character I've been describing.
<schlick>
It looks the same in IE and Firefox (however I can't see half the other stuff in IE).
<vodka-goo>
I have a line made of dashes, and the first char below is Ω
<schlick>
<thingy> <turnstile> A type <thingy>, x:A <turnstile> B type
<schlick>
That's the top line. The "<thingy>" is what I'm trying to understand.
<schlick>
The boxes right below the sentence saying "These quantified types are written <list of symbols> instead of <list of symbols> and have the following formation rules:"
<schlick>
Nobody knows?
<pango>
looks like "capital gamma" that vodka-goo posted above
<schlick>
Hmm, doesn't look the same in my chat client.
<schlick>
Ok, if that's what it is, what does that mean?
<schlick>
I got a one word definition that says "context". That's not enough for me to understand.
khaladan has joined #ocaml
<schlick>
Anybody out there?
ski_ has joined #ocaml
Schmurtz has joined #ocaml
ski__ has joined #ocaml
ski has quit [Nick collision from services.]
ski_ has quit [Nick collision from services.]
ski__ is now known as ski
pango has quit ["Client exiting"]
pango_ has joined #ocaml
pango_ is now known as pango
cookoo has quit []
cookoo has joined #ocaml
mellum has joined #ocaml
mikeX_ has quit ["leaving"]
Bigb[a]ng is now known as Bigbang
vodka-goo has quit ["j'ai peur"]
bluestorm has quit [Remote closed the connection]
gim has joined #ocaml
rillig has quit ["exit(EXIT_SUCCESS)"]
gim has quit ["dodo"]
pango has quit ["Terminated with extreme prejudice - dircproxy 1.0.3"]