<ita>
aaargh pourquoi List.sort veut pas me trier ma liste ?
<Smerdyakov>
You'd probably make it more likely that someone could help you if you used English.
<ita>
Smerdyakov: no, i don't talk to english people ;-)
<ita>
i'm trying to sort a list using List.sort, but it won't work
<ita>
ok, just found out : i didn't pick up the resulting list -> (*let population2 = *)List.sort h population;;
<Smerdyakov>
Ah, you have much to learn. ;)
<Smerdyakov>
(You smell like C++. ;D ;D ;D ;D)
<ita>
Smerdyakov: how do you know ?
<Smerdyakov>
Because you expected List.sort to work imperatively on a functional datatype.
Kinners has joined #ocaml
<ita>
Smerdyakov: hehe right
<teratorn>
i'm fairly new to ocaml and wondering, is there any reason datatype functions, like List.sort could not be implemented as methods of the datatype?
lophty__ has joined #ocaml
<Smerdyakov>
They could if datatypes were class objects, but they're not.
<teratorn>
datatypes could be make to work like class instances.. (?)
<teratorn>
even thougth they're implemented differently
<ita>
grr why the fsck won't this work -> let mutation (mpopulation) = List.hd mpopulation :: (List.map f (List.tl mpopulation));;
<teratorn>
i'm guessing ocaml wasn't designed as an obejct-oriented language from the start
<Kinners>
teratorn: right
<ita>
"This expression has type unit list but is here used with type empilement list" ?
<Kinners>
teratorn: it was Caml Light (or something similar) before becoming Objective Caml
<ita>
caml light .. like the cigarettes ?
<Kinners>
you would think so
<Kinners>
ita: try putting brackets around List.hd mpopulation?
<ita>
Kinners: ok
<ita>
mmm still broken :-/
<Kinners>
ita: it's a problem with the function passed to List.map?
<Kinners>
ita: plus it's better to use pattern matching instead of List.hd and List.tl, if the list is empty those functions will raise an exception
<ita>
ok, good idea
<ita>
(i want to apply a map to the last elements of the list only)
<Kinners>
check your map function
<Kinners>
f
Smerdyakov has quit [Read error: 110 (Connection timed out)]
Smerdyakov has joined #ocaml
<ita>
Kinners: thanks, the function f was wrong (did not return the object)
pattern_ has quit ["..."]
polin8 has quit [Read error: 110 (Connection timed out)]
drWorm has quit [Read error: 60 (Operation timed out)]
lophty__ has quit ["ChatZilla 0.8.31 [Mozilla rv:1.4/20030624]"]
Smerdy has joined #ocaml
Smerdyakov has quit [Nick collision from services.]
Smerdy is now known as Smerdyakov
Xcalibor has quit [Read error: 113 (No route to host)]
Kinners has left #ocaml []
<Maddas>
heh
<Maddas>
I really must be doing something wrong.
<Maddas>
How do I implement push with a list?
<Maddas>
let stack = [0];; let push x = stack <- (x :: stack);; doesn't work
<Maddas>
let stack = ref [0];; let push x = stack := (x :: !stack);; doesn't work either
<Maddas>
What am I doing wrong?
<karryall>
nothing
<karryall>
it works
<Maddas>
weird
<Maddas>
it does
<Maddas>
thanks karryall! :)
<Maddas>
I must have had some old weird declarations left while running ocaml, restarting it helped
<Maddas>
Butthe first version doesn't work
<Maddas>
Unbound instance variable stack
<Maddas>
oh well, I'll just use a ref.
<Maddas>
oh
<Maddas>
of course it doesn't work, duh. Never mind :)
<Maddas>
I even push any kind of values onto the stack, but pop always returns 0.
<Maddas>
Rather, it always seems to return whatever was in !stack when pop was defined
<Maddas>
It doesn't even seem to pop, gah
<Maddas>
oh
<Maddas>
pop isn't recognised as a function if I don't say let pop = ()
<Maddas>
err
<Maddas>
let pop () =
<Maddas>
heh
async has quit ["Lost terminal"]
<Maddas>
I'll just do let pop = function z -> somestuff
<Maddas>
no, that's no good either
<Maddas>
jeez
<Maddas>
how do I declare pop as a function without parameters
<Maddas>
I don't want to call it as pop ();;, but just as pop;;
<karryall>
you can't, all functions have exactly one parameter
<karryall>
if you're not interested in the parameter, use ()
<karryall>
let pop () = ...
buggs|afk is now known as buggs
<Maddas>
I see, ok
Verbed has joined #ocaml
asqui has quit [Connection reset by peer]
asquii has joined #ocaml
asquii is now known as asqui
brwill is now known as brwill_zzz
mr_bubbs_ has joined #ocaml
mr_bubbs has quit [Read error: 104 (Connection reset by peer)]
mr_bubbs_ has left #ocaml []
srv has joined #ocaml
buggs has quit [Read error: 104 (Connection reset by peer)]
buggs has joined #ocaml
asqui has quit [Read error: 104 (Connection reset by peer)]
buggs is now known as buggs|afk
drWorm has joined #ocaml
polin8 has joined #ocaml
two-face has joined #ocaml
bk_ has joined #ocaml
<two-face>
hi, bonjour, buon giorno, guten tag
<Maddas>
morning
asqui has joined #ocaml
<two-face>
so we were talking about vim :)
<Maddas>
haha :)
asquii has joined #ocaml
asqui has quit [Read error: 54 (Connection reset by peer)]
asquii is now known as asqui
<ita>
if i declare the type : "type empilement = {p : int list ; rot : int list};" how can i declare a new object of the type empilement ? i've tried : { [1;2] ; [2;3] };; but it does not work - any idea ?
asqui has quit [Client Quit]
<bk_>
let foo = [ p = [1;2] ; rot = [3;4] }
<ita>
oh
<bk_>
oops
<bk_>
let foo = { [ p = [1;2] ; rot = [3;4] }
<ita>
it works !
<ita>
thanks bk_
<bk_>
:p
asqui has joined #ocaml
asqui has quit ["Now I am gone..."]
<ita>
bk_: and how to access the rot element in foo ? foo#rot ?
<two-face>
foo.rot
<two-face>
hmm no
<ita>
yes it is
<ita>
thanks
<ita>
i mixed with class stuff
<two-face>
classes: a#b
bk_ has quit ["leaving"]
<Maddas>
huh
<Maddas>
weird
<two-face>
huh?
<Maddas>
how do I declare a named variable and declare the type at the same time?
<Maddas>
let foo ~(bar:baz) creates the named argument bar and assigns it to baz
<Maddas>
but how would I declare that as an integer now?
<two-face>
let ~a:int = 1 ?
<Maddas>
I don't want a to be bound to the variable a
<Maddas>
e.g. # let fooa ~bar:baz = baz + 2;;
<Maddas>
val fooa : bar:int -> int = <fun>
<Maddas>
# fooa ~bar:5;;
<Maddas>
- : int = 7
<Maddas>
works this way
<two-face>
so?
<Maddas>
how do I declare baz as an int now?
<Maddas>
In cases where I want to declare it explicitly, not as in here
<Maddas>
note that yours doesn't work properly here
<Maddas>
# let fooa ~bar:int = bar + 5;;
<Maddas>
Unbound value bar
<Maddas>
you meant ~(a:int)
<two-face>
you can't do that
<Maddas>
not ~a:int
<Maddas>
Why not?
<two-face>
it is necessarily int
<Maddas>
I'm not talking of this case
<Maddas>
I'm talking of general cases
<Maddas>
this was just an example
<two-face>
so do you need :baz ?
asqui has joined #ocaml
<Maddas>
That's part of my question, yes
<two-face>
you will always have a know type after ":"
<Maddas>
Otherwise my example wouldn't work anyway.
<Maddas>
Anybody else have an idea? :)
<two-face>
I can see function calls, do declarations
<Maddas>
check named parameters
<Maddas>
even the first example shows what I do
<two-face>
I thought it was ~a=baz
<two-face>
so, in fucntion calls, ~a:bar passes a with value bar to the function
<Maddas>
I'm talking about function declarations :)
<Maddas>
anyway, gtg,laetr
* two-face
is away: I'm busy
* two-face
is back (gone 00:00:03)
mattam_ has joined #ocaml
asqui has quit ["Now I am gone..."]
mattam has quit [Read error: 110 (Connection timed out)]
asqui has joined #ocaml
mattam_ is now known as mattam
Yurik has joined #ocaml
<Yurik>
re
<two-face>
yurik!
<Yurik>
two-face: yep! :)
<Yurik>
it's I'm :)
<two-face>
how doing?
<Yurik>
well, thinking that I should change company again :-] hehe
<two-face>
not the good moment
<two-face>
methink
<Yurik>
well, I'm invited in startup
<Yurik>
and current company smells bad
<two-face>
in ukraine?
<ita>
mm why doesn't this work : let trans (e : empilement) = e.h = Random.int 100; e;;
<Smerdyakov>
C++ man strikes again!
<Yurik>
two-face: yes
<two-face>
ROTFL!
<ita>
ok, mutable thing (understood !)
<Smerdyakov>
Did you know that = is a comparison, not assignment, operator in Caml?
<Yurik>
Java and Python smells bad
<two-face>
Yurik: what kind of startup?
<ita>
Smerdyakov: yes, c++ guy ;-)
<two-face>
I love Python
<Yurik>
two-face: software development startup
<two-face>
Yurik: with linux or anything else?
<Yurik>
two-face: yes
<Yurik>
two-face: with linux
<two-face>
Yurik: very nice
<Yurik>
two-face: i like lisp+linux for my current projects
<two-face>
i don't speak you language, but I'm interested :)
<two-face>
what lisp?
<Yurik>
two-face: you speak English at least
<Yurik>
two-face: common lisp
<two-face>
and ocaml ?
pattern_ has joined #ocaml
<Yurik>
two-face: currently I do not see application for ocaml in our ideas but probably it is a topic to discuss (some things may require ocaml use)
<two-face>
Yurik: so why lisp and what lisp implementation?
<two-face>
(if you don't mind answering :)
<Yurik>
two-face: well, the reasons to use lisp is a subject for a long conversation :) and impl. is cmu or sbcl
<Smerdyakov>
Yurik, let's have a long conversation!
<two-face>
Yurik: i'm curious about main arguments, i've nothing against lisp
<Yurik>
two-face: well, main things are short development cycle, adaptation of language to task and not task to language, macroses ;), dynamic nature of Lisp...
<Yurik>
Smerdyakov: ocaml vs. lisp flamewar? .)
* Yurik
in fact likes both ocaml and lisp and even have some little bits in humps ;0
<Yurik>
s/;0/;)/
<two-face>
Yurik: some PS2 games where written in Clisp
<Smerdyakov>
Yurik, no, more like explanation of why you chose Lisp/
<Yurik>
Smerdyakov: ah. it is since the basic components we need in our project are frame database, workflow engine and transaction engine
<Smerdyakov>
Yurik, short development cycle is the only objectively beneficial thing in your list.
<Smerdyakov>
Yurik, the other things you claim lead to a shorter development cycle. :P
<Yurik>
Smerdyakov: it's quite important for us
<two-face>
There is a Free lisp book called "On lisp"
<Yurik>
two-face: I read it.
<Smerdyakov>
Yurik, yes, but you haven't shown that Lisp enables it better than ML.
<two-face>
Yurik: good enough?
<Yurik>
Smerdyakov: well, I think because of dynamic typing and macroses, which are really powerful in adaptation language to task than camlp4
<Yurik>
Smerdyakov: and much easier
<Yurik>
two-face: well, it's quite good book
<Smerdyakov>
Yurik, why do you need fancy systems when you have first-class functions?
<Yurik>
Smerdyakov: well, probably I couldn't answer to your questions coz can't understand it completely ;)
<Smerdyakov>
Yurik, can you give a minimal (and real) example where you think macros are necessary to get good productivity?
<Yurik>
Smerdyakov: yes -- very handy adaptation of language to a particular needs (including programming paradigms)
<Smerdyakov>
Yurik, I'm looking for something more specific than that.
<Yurik>
Smerdyakov: ok, how will you implement, say, AOP in OCaml (I know, that's possible, but how)
<Smerdyakov>
Yurik, ah, but first you have to justify that AOP is necessary for that to matter!
<Yurik>
Smerdyakov: (it seems that we've shifted from the main stream). Initial topic was short development cycly. As for my experience (I'm basing on it to judge) Lisp devcycle shorter than ocaml's one
<Yurik>
Smerdyakov: AOP is just an example
<Smerdyakov>
Yurik, it is not an example that fits my criteria until/unless it is justified as "real."
<Yurik>
Smerdyakov: ok, language integrated with frame database
<Smerdyakov>
Yurik, what's a frame database?
<Yurik>
Smerdyakov: Minsky's frames
<Smerdyakov>
Yurik, can you give a formal definition?
<Maddas>
16:30 < Smerdyakov> Yurik, short development cycle is the only objectively beneficial thing in your list.
<Maddas>
short development cycle is very important :)
<Maddas>
Not that I'd say O'Caml performs worse, I yet have to learn it. (Same for LISP)
<Maddas>
But IMO, developing things quickly is a pretty important criteria, as human time is usually far more costly than CPU time
<Yurik>
Smerdyakov: google? ;)
<Maddas>
I really should learn LISP, gah.
<Maddas>
And O'Caml.
<Maddas>
And Haskell.
* Maddas
sighs
<Maddas>
:)
<Maddas>
And Ruby and Python
<Yurik>
Smerdyakov: well, it is like object in CLOS (frame is a set of slots, if easily)
<Yurik>
but then there are facets, metaframes...
* Maddas
goes on fighting against the ocaml documentation
<Smerdyakov>
Yurik, and what is an example of a particular Lisp macro that you find indispensable?
<Smerdyakov>
Maddas, ? I think it's very good documentation.
<Maddas>
Which?!?
<Smerdyakov>
Maddas, all
<Maddas>
I must be looking at the wrong.
<Yurik>
Smerdyakov: (defmacro example?
<Maddas>
I think the O'Reilly book is rather bad
<two-face>
what book?
<Smerdyakov>
Yurik, English text description would be best, and I mean an concrete macro related to "frame databases."
<Maddas>
Or, if not, I must be accidentally skipping every second page or something :-)
<Maddas>
Smerdyakov: can you explain me how to do something in o'caml?
<Maddas>
I didn't figure it out myself.
<Smerdyakov>
Maddas, I don't count that in "the OCaml documentation"
<Smerdyakov>
Maddas, probably
<Maddas>
Smerdyakov: then which OCaml documentation do you mean?
<Maddas>
I'm struggling to find good documentation ;-)
<Smerdyakov>
The manual on the web site..
<Maddas>
Hm, ok. I just went through the links
<Maddas>
I'll look again
<Yurik>
Smerdyakov: I just could use frames in database as language constructions
<Yurik>
(if simply)
<two-face>
war among soviets!
<Maddas>
Smerdyakov: How do I create a named parameter and specify the time at the same time?
<Maddas>
haha two-face
<Maddas>
Smerdyakov: I can do "let foo ~(bar:int)", I can do "let foo ~bar:baz", but how do I do both?
<Smerdyakov>
Maddas, oh, I don't know about named parameters, but I know it's described in detail in the manual.
<Maddas>
Ok.
<Yurik>
two-face: hehe
<Smerdyakov>
Maddas, but I'd guess ~(bar:int):baz
<Smerdyakov>
Yurik, what's wrong with using an ML record for a frame?
<Yurik>
Smerdyakov: nothing wrong. Lisp is more natural for this
<Maddas>
Smerdyakov: do you develop things in o'caml?
<Yurik>
Smerdyakov: it's even very easy to map frames and CLOS objects and do interoperation between db and objects via MOP
<Smerdyakov>
Yurik, well, this also depends on a justification that it is appropriate to represent frames in the Lisp. :)
<Smerdyakov>
Maddas, yes
<two-face>
Hey people, stop that language war!
<Yurik>
two-face: :)
<Maddas>
Smerdyakov: maybe it's just personal preference of him :)
<Maddas>
Smerdyakov: What kind of things do you develop?
<two-face>
Enemy at the Gates! Let's burn Moscow! We won't let them in!
<Maddas>
I'm just wondering what people usually do with O'Caml :)
<Yurik>
Smerdyakov: read "beating the averages" by paul graham ;)
<Smerdyakov>
Maddas, "personal preference" is not valid in choosing technical tools.
<Smerdyakov>
Yurik, the "how we kicked ass with Yahoo! store"?
<Yurik>
Smerdyakov: something like that :-) There are several good thoughts on language selection
<Smerdyakov>
Maddas, enlightened people use OCaml for almost everything.
<Maddas>
haha
<Maddas>
:-)
<Yurik>
well, orbitz.com uses Lisp inside. Is there any comparable technology w/ ML?
<Maddas>
Smerdyakov: Why not? I would think that you work better with tools that naturally adapt to the way you think and which allow you to enjoy coding more.
<Maddas>
Of course, if there are strong technical disadvantages, the choice is a bad one.
<Smerdyakov>
Maddas, I think a person is obligated to prove that he is predisposed to think in a narrow way before making that argument.
<Maddas>
Why?
<Maddas>
Why would somebody need to justify the choice of language?
<Smerdyakov>
Yurik, dunno. http://www.sourcelight.com uses or used some reasonable-sized ML-based database software.
<Maddas>
If that person says that the choice is technically better, ok, that's something else.
<Smerdyakov>
Maddas, I would posit that an engineer who makes choices of tools based on non-technical reasons is a bad engineer.
<Maddas>
(Maybe I didn't pay enough attention to the beginning of this conversation ;-))
<Maddas>
Smerdyakov: I don't disagree.
<Maddas>
But this sounds to me like it's more something of a hobby-thing
<Smerdyakov>
Maddas, I always work under the assumption that programming is done for practical engineering.
<Smerdyakov>
Maddas, and if you're talking about Yurik, he said it was for a start-up company, I think.
<Maddas>
oh, ok.
<Maddas>
Smerdyakov: I do volountary work only if I feel like doing it or have some other form of motivation.
<Smerdyakov>
Not to mention that it's more fun to program with better tools, unless you're an idiot. :P
<Maddas>
Not necessarily :)
<Maddas>
Some languages are just very awkward to some people.
<Smerdyakov>
I don't accept that.
<Maddas>
Why not?
<Maddas>
So why doesn't everybody love or hate the same languages, lets say, Perl?
<Smerdyakov>
People who find reasonable languages awkward are not fit to be programming :P
<Maddas>
I didn't say 'reasonable' languages
<Smerdyakov>
Because of limited human perception and general irrationality.
<Yurik>
perl is write-only
<Yurik>
;)
<Maddas>
No it's not
<Maddas>
So, if people are irrational in general, why should they force themself to make rational decisions when choosing a tool?
<Smerdyakov>
Because they should aspire towards rationality in engineering.
<Maddas>
I disagree.
<Maddas>
Not all engineering is done to create programs, some is done just for the sake of learning or having fun.
<Smerdyakov>
Then pretend whenever I mention it, I mean the first kind only.
<Maddas>
In corporate environments, this is something else, of course.
<Smerdyakov>
I really don't care about the second kind.
<Maddas>
Ok
<Maddas>
You see, I'm not a professional programmer or studying Comp Sci, so I don't encounter the first kind too much :-)
<Smerdyakov>
I've encountered it when programming as a hobby.
<two-face>
BBL
<Smerdyakov>
The idea of not caring about the final product of development is alien to me.
<Maddas>
I have too, but only once so far.
two-face has quit ["Client exiting"]
<Smerdyakov>
I only just recently realized that some people feel that way.
<Maddas>
Nobody talks about not caring about the final product, but I wouldn't mind putting in a bit more effort if I can have more fun along the way then.
<Smerdyakov>
All of the fun is in the result for me.
<Maddas>
And if I have the itch to write a certain piece of software in a certain language, then I'll scratch it.
<Maddas>
Well, I guess you're different than me then
<Maddas>
I'm doing most of what I do simply to learn
<Maddas>
the result being a nice side-effect.
* Yurik
looks sorry. I initiated argues ;)
<Maddas>
Once I get proficient enough in a language, then I can start worrying.
<Maddas>
Hey, if I wouldn't care about using the proper tool at all, I wouldn't be learning O'Caml :)
<Maddas>
Yurik: I like discussing, otherwise I wouldn't bother
<Maddas>
But I don't have time to learn too many languages, so sometimes I won't be able to use the most appropriate tool for a certain job.
<Smerdyakov>
It's possible to get to the point where you can learn pretty much language is you go on a project using itl.
<Yurik>
Maddas: I just felt is a war, not discussion :) sorry again
<Smerdyakov>
s/is you go/as you go
<Smerdyakov>
s/pretty much/pretty much any
<Maddas>
Smerdyakov: it is, but that is not doable in near future for me.
<Maddas>
itl?
<Smerdyakov>
Maddas, how long have you been programming?
<Smerdyakov>
s/itl/it
<Maddas>
oh, ok :)
<Maddas>
Smerdyakov: Two years or so. I didn't actively program though, I only wrote something whenever I needed something which didn't exist.
<Smerdyakov>
Ah, OK.
<Maddas>
I am being more active since the last few months.
<Maddas>
Started learning Scheme, reading the SICP, learning O'Caml
<Smerdyakov>
I think that you don't need to learn more than 6 languages to be able to pick up pretty much any other easily.
<Maddas>
I agree
<Maddas>
But learning 6 languages well is time consuming :)
<Smerdyakov>
*shrug*
<Smerdyakov>
If you are "in the real world" now, then perhaps you missed a good chance when you were younger.
<Maddas>
Yes, I definitely missed the chance to start earlier.
<Maddas>
I'm starting at my university this october, but I won't be studying Computer Science, so I won't have too much time to learn more languages.
<Smerdyakov>
I've been programming for 16 years now. I started when I was 6. :)
<Maddas>
Bah
<Maddas>
:)
<Maddas>
I should have started much earlier, I am aware of that. But neither of my parents even know how to use a computer, so I can't blame them :)
<Maddas>
Smerdyakov: which is your favourite language?
<Maddas>
Not in technical terms, just by which one is the one you like to program in most.
<Maddas>
s/by//
<Maddas>
You see, I think programming should be fun. Unless you're paid to do it, or something like that :)
<Maddas>
And I can understand if certain people have more fun using one language than using another.
<Maddas>
As you said, people are irrational, and especially if somebody isn't proficient in many languages, learning a new language might not be worth the effort
<Maddas>
Considering that most projects aren't very big
<Maddas>
Although this refers to the kinds of engineers you weren't talking about :)
* Maddas
goes to read again, in order to catch up with Smerdyakov
<Maddas>
s/,//
<Maddas>
Are you ignoring me or something? :)
<Yurik>
;))
<pattern_>
he's probably just stepped away from the keyboard
<Maddas>
:)
<Maddas>
Thing is, I wanted to bother him with a question ;)
<pattern_>
what was the question?
<Maddas>
Can you declare a ("normal") list mutable, or do I need to use a ref?
<Yurik>
array?
<Maddas>
List :)
<Yurik>
afair, list in ocaml is immutable
<Yurik>
;))
<Yurik>
but I'vent used ocaml for more than 0.5year at all so I could mistake
<Smerdyakov>
They're all related to improving productivity. I don't recognize "writing code for the fun of it" as valid, personally.
<Maddas>
Heh
bk_ has joined #ocaml
<Maddas>
I wouldn't code if I wouldn't enjoy it or find it rewarding otherwise :-)
<Smerdyakov>
Yes, and I find the end products rewarding.
<Maddas>
I'm not proficient enough to code very useful programs yet :)
<Smerdyakov>
And you will never become proficient if you don't focus on end goals.
<Maddas>
My current end goal is to learn.
<Smerdyakov>
Then you will not be successful in it, unless you find someone else to come up with goals for you.
<Maddas>
Other goals will come up later on
<Smerdyakov>
Or, at best, you will be successful at a glacially slow pace, as you essentially grope around in the darkness and occasionally learn something useful.
<Maddas>
But I've got no ideas what to write, currently
<Smerdyakov>
I am claiming that you will take too long to reach this "later on."
<Smerdyakov>
Just like if you tried to learn basic arithmetic without concern for correct answers.
<Maddas>
What has this to do with correct answers?
<pattern_>
i think i agree that it helps to have a reason to learn... just learning for learning's sake might not be as effective as learning as a means to an end
<Smerdyakov>
The goal of doing arithmetic is to find the answer.
<Maddas>
I have a reason to learn, but not a specific program that I'm trying to write.
<pattern_>
but having fun along the way is important too... it's not just the goals that matter, imo
<Smerdyakov>
Maddas, and I say that that will leave you without the motivation to learn quickly enough.
<Maddas>
Smerdyakov: Yes, and there usually are multiple ways of getting there.
<Maddas>
Smerdyakov: I understand, that's the way it is at the moment.
<Maddas>
But I do plan to set goals to myself once I understand the language better
<Smerdyakov>
Well, it sounds like you're running out of time.
<Smerdyakov>
After you graduate from university, most likely you will not be inclined to learn more about programming.
<bk_>
just imho learning is more fun and rewarding if there's something you'd like to achieve w/ what you're trying to learn
<Maddas>
I don't know enough to achieve anything good yet ;)
<Smerdyakov>
And you don't know what you want to know, which prevents you from learning it!
<bk_>
i've picked a small 'goal' for me, and i'm learning whats necessary to get there
<Maddas>
I'm just reading the manuals and stuff right now
<Maddas>
I've tried to do something, but it was pretty frustrating, as I was learning from a bad source
<pattern_>
yeah, but you could have a long-term goal
<Maddas>
Yes, I can't think of any good one.
<Maddas>
I don't know the strengths of O'Caml enough yet
<Maddas>
And I'm really not very creative :)
<Smerdyakov>
O'Caml is a general purpose language.
<Smerdyakov>
Would you feel uncomfortable choosing a project to code in C++ because you don't know its strengths?
<Maddas>
hm, I don't know, probably not.
<Maddas>
You've got a point :)
<Maddas>
Now, I still need an idea. Any proposals? ;-)
<Maddas>
I guess I could try a scriptable FTP client, or something like that.
<bk_>
usually toy projects are boring, try to think of something that you'd like to use, perhaps
<Maddas>
Yes, that's the problem.
<Smerdyakov>
I think if you don't have an idea for something that isn't available that you want, then it might not be worth it for you to learn programming!
<Maddas>
There's not much that I want to use that I haven't got already ;)
<bk_>
or try to think of something that is available, but doesn't exactly do what you want
<Maddas>
I can think of things, but I'm not very self-confident and I doubt that I'd finish any of them anytime soon.
<Maddas>
Maybe I should worry less and just start something :-)
<Smerdyakov>
That doesn't matter. The big goals suggest smaller goals recursively.
<Maddas>
Hm, I see.
<Maddas>
I guess I could just start something then.
<Maddas>
:-)
<Maddas>
Smerdyakov: I think I start to understand the way you think, and why I think/thought differently.
<bk_>
whats the problem as long as noone is pushing you, you can take your time, no ?
<Maddas>
I should push myself, that's what I never did
<Maddas>
I think I only used "I'm doing it for the fun" as an excuse for not getting anywhere
<bk_>
my code is a mess heh
<Maddas>
Are there decent networking (TCP/IP, parsing the things myself) libraries for O'Caml?
<bk_>
hm, the usual socket stuff is available in the Unix module
<Yurik>
Maddas: ocamlnet?
<Maddas>
Ok, I'll have a look
<Yurik>
Maddas: and sockets in standard lib
<Maddas>
I should use Ratpoison again, these normal window managers keep distracting me from whatever I'm doing, brb :)
<mrvn>
I'm working on a asynchronous IO library specifically for net stuff.
<Maddas>
That would be cool for something else which I'm also planning to do.
<Maddas>
I think :)
<mrvn>
You could write a ftp module.
<mrvn>
or asynchronous dns.
<Maddas>
That's what I'm planning
<Maddas>
Doing something like a ftp module
<mrvn>
The full ftp specs realy suck.
<Maddas>
I don't know :)
<mrvn>
try to read them.
<Maddas>
Heh. I never read the original RFC
<Maddas>
I read the "Security Extensions for FTP" RFC (It's nice and small) and the ftp-ssl draft, though.
* Yurik
is away: ñ ÚÁÎÑÔ
Yurik has quit ["÷ÙÛÅÌ ÉÚ XChat"]
CybeRDukE has joined #ocaml
brwill_zzz has quit [Read error: 104 (Connection reset by peer)]
bk_ has quit ["I'll be back"]
d-bug has joined #ocaml
bk_ has joined #ocaml
CybeRDukE has quit ["There are 10 kinds of people in the world: Those who understand binary and those who don't..."]
srv has quit [Remote closed the connection]
__buggs has joined #ocaml
lightstep has joined #ocaml
<lightstep>
quit
lightstep has quit [Client Quit]
lightstep has joined #ocaml
<lightstep>
how does ocaml know about package names, eg. that Random resides at random.mli?
<lightstep>
or maybe a better question would be, where can i find an explanation about how the module system works?
buggs|afk has quit [Read error: 110 (Connection timed out)]
<Maddas>
lightstep: it's the filename in lowercase + mli, IIRC :)
<Maddas>
Smerdyakov: are you there?
<mrvn>
What about recusive modules?
<mrvn>
module Foo = struct module Bar=struct...end end
<Maddas>
mrvn: By the way, how far are you with the asynchronous thingy library?
<mrvn>
Should that be in foo.mli or foo/bar.mli?
<Maddas>
I'm thinking of making a game server, accepting connections of clients
<Maddas>
Then exchanging commands and all
<mrvn>
Maddas: I have input and output for various ints and ssring.
<mrvn>
strings
<Maddas>
I see
<Maddas>
So it is already usable?
<Maddas>
e.g. could you already query multiple servers at the same time for a certain string?
<Maddas>
err
<mrvn>
sure.
<Maddas>
Cool.
<Maddas>
And you wouldn't have to wait for each server to respond before querying the next?
<mrvn>
val make_socket : [ `Inet of string * int] -> (io -> unit) -> unit
<mrvn>
You pass it the name and port and a function to be called when the connect is ready.
<Maddas>
Cool.
<Maddas>
I'll have to dive into it once. Sounds promising :)
<mrvn>
It works with a format string if you want to read structures.
<mrvn>
UnixIO.schedule_read unixIO (UnixIO.netuint16 $ UnixIO.netint64 $ UnixIO.netline '\n') (fun i j line -> ...)
<mrvn>
to read a strcuture of an uint16, an int64 and a '\n' terminated line.
<Maddas>
what the heck.
<Maddas>
:-)
<mattam>
reads like haskell
<Maddas>
I never read haskell
<mrvn>
It checks the type of what you want to read and the function recieving it.
<Maddas>
mrvn: Isn't there a way to just read whatever got sent? :-)
<mrvn>
Maddas: How do you know the type?
<Maddas>
Well, I'd want it as a string.
<Maddas>
Is that just UnixIO.netline '\n'?
<Maddas>
mrvn: I don't know about low-level things, if you didn't notice yet ;)
<mrvn>
Thats to read a '\n' terminated line.
<mrvn>
You can also read a string of length x.
<Maddas>
Oh, that should suffice.
<mrvn>
But for say http you want to read a rfc822 header but stuff like that is easily added.
<mrvn>
I just started with a few datatypes I needed.
<Maddas>
I see.
<mrvn>
By the way, the (...) format thing in reading is also used when writing. You can define it once and use the same for read/writes, thus ensuring that you read/write the same format.
<ita>
ls
<ita>
dammit
<Maddas>
So it would be easy to parse fixed length messages?
<mrvn>
Stuff like network/host byte order conversions would be the next thing needed I think.
<Maddas>
Or things like: One byte specifies the type of message, the next byte specifies how long the following message will be