malc has joined #ocaml
mimosa has quit ["I like core dumps"]
Defcon7 is now known as phewngaw
malc has quit ["no reason"]
Kinners has joined #ocaml
paganini has joined #ocaml
<
ita>
what does such a warning mean ? Warning: this expression should have type unit.
<
Kinners>
you're using an expression that doesn't have type unit in a place where it should
<
Kinners>
such as, let foo = 2;3;;
<
Kinners>
whereas, let foo = print_int 2; 3;; print_int is int -> unit
GreyLensmen has quit ["toast"]
Herrchen_ has joined #ocaml
Herrchen has quit [Read error: 110 (Connection timed out)]
ita has quit [Read error: 54 (Connection reset by peer)]
afx has joined #ocaml
Kinners has left #ocaml []
joel_ has joined #ocaml
jrosdahl has quit [Read error: 110 (Connection timed out)]
gim has joined #ocaml
systems has joined #ocaml
srv has joined #ocaml
systems has quit ["Client Exiting"]
mattam_ has joined #ocaml
mattam has quit [Read error: 110 (Connection timed out)]
srv has quit ["leaving"]
lus|wazze has joined #ocaml
avn has joined #ocaml
Kinners has joined #ocaml
__DL__ has joined #ocaml
malc has joined #ocaml
mimosa has joined #ocaml
malc has quit [Read error: 54 (Connection reset by peer)]
malc has joined #ocaml
brwill has quit [Read error: 60 (Operation timed out)]
brwill has joined #ocaml
Kinners has left #ocaml []
phewngaw is now known as Defcon7
systems has joined #ocaml
systems has left #ocaml []
demitar_ has joined #ocaml
Demitar has quit [Read error: 54 (Connection reset by peer)]
malc has quit ["no reason"]
demitar_ is now known as Demitar
_Defcon7 has joined #ocaml
jmarant has joined #ocaml
Defcon7 has quit [Read error: 110 (Connection timed out)]
cm has quit [Read error: 104 (Connection reset by peer)]
cm has joined #ocaml
malc has joined #ocaml
ita has joined #ocaml
Herrchen_ is now known as Herrchen
<
drlion>
is it impossible to define a type polymorphic over two other types?
<
drlion>
type 'a 'b t = Foo of 'a * 'b;; gives me a syntax error
<
Smerdyakov>
type ('a, 'b) t = ....
<
drlion>
oh. thanks :-)
<
Smerdyakov>
You've never used a type polymorphic in more than one variable before? (I don't mean defined; I mean used an existing one.)
<
drlion>
yeah, hehe, i just realized that
<
drlion>
i just felt i had tried every possible syntax
malc has quit ["no reason"]
<
ita>
dammit i can't stop thinking in c++
<
Smerdyakov>
That means you probably don't know C++ well.
<
ita>
Smerdyakov: fsck you :)
mattam_ is now known as mattam
<
ita>
is someone using facile here ?
jmarant has quit [Remote closed the connection]
Defcon7 has joined #ocaml
_Defcon7 has quit [Read error: 104 (Connection reset by peer)]
maihem has joined #ocaml
<
ita>
mmm i never know when to put a semicolon, two semicolon or no semicolon
<
smkl>
you don't have to use ";;" at all
<
Demitar>
ita, two semicolon: only at toplevel.
<
Demitar>
smkl, There are times when it's needed. ;-) let foo = ref 1;; print_int !foo
<
Demitar>
ita, and use one semicolon once you want to evaluate something new.
<
Demitar>
smkl, written anything exciting lately btw?
buggs has joined #ocaml
<
smkl>
Demitar: nope. i rewrote some of my stuff about a year ago, and i still haven't debugged it all
<
ita>
Demitar: ok, thanks
<
Demitar>
ita, what? You mean you understood what I meant? ;-)
* Demitar
thought is was kind of cryptic. :)
<
ita>
Demitar: i couldn't understand why i had to put two semicolons at topelevel
<
ita>
it gave me strange syntax errors
<
Smerdyakov>
You never need to use semicolons after declarations in a well structured program.
<
Demitar>
Smerdyakov, "never" assumes you want to use let _ =, right? :)
<
ita>
it is sometimes worse than perl :/
<
Demitar>
ita, in what way?
<
ita>
the semicolons
owll has joined #ocaml
<
Demitar>
Nah, it's simple as soon as you understand why.
<
ita>
Demitar: and the let _
owll has left #ocaml []
<
Demitar>
ita, let _ = is very simple really, it fits with how everything else works.
<
Demitar>
You're just set in your C-syntax ways. :)
<
Smerdyakov>
Demitar, no.
<
smkl>
module toplevel syntax is pretty confusing. in the revised syntax it's different
<
Demitar>
Smerdyakov, no to what? :)
<
Smerdyakov>
<Demitar> Smerdyakov, "never" assumes you want to use let _ =, right? :)
<
Demitar>
Smerdyakov, well, how would it be done otherwise? Enlighten me.
<
Smerdyakov>
let a = 1 let b = 2
<
smkl>
use "let () = ..."
<
Smerdyakov>
You should have all code that is actually run inside of functions.
<
Demitar>
Smerdyakov, yes, yes but you have to make it actually evaluete something.
<
Smerdyakov>
There's no need to mix expressions and declarations.
<
Smerdyakov>
And you put that as a single functionc all in a separate file, Demitar.
<
Demitar>
Ie something has to call the "main" function.
<
Smerdyakov>
See above. :)
<
Demitar>
Smerdyakov, now that sounds evil to me. ;-)
<
Smerdyakov>
In SML/NJ, you just specify a main function to call at compile time.
<
Smerdyakov>
It's not "evil." It's a good way to organize a project.
<
Smerdyakov>
As few side effects to track as possible.
brwill has quit [zelazny.freenode.net irc.freenode.net]
mattam has quit [zelazny.freenode.net irc.freenode.net]
phubuh has quit [zelazny.freenode.net irc.freenode.net]
async has quit [zelazny.freenode.net irc.freenode.net]
Maddas_ has quit [zelazny.freenode.net irc.freenode.net]
brwill has joined #ocaml
mattam has joined #ocaml
phubuh has joined #ocaml
async has joined #ocaml
Maddas_ has joined #ocaml
asqui has quit [Excess Flood]
asqui has joined #ocaml
<
ita>
how do i declare a function with a pointer to an array as a parameter ?
<
Smerdyakov>
No pointers in OCaml.
<
mellum>
And no function declarations.
<
ita>
Smerdyakov: the thing with !
<
Smerdyakov>
References.
<
Smerdyakov>
Why do you want a reference to an array? You will change which array it references over time?
<
Smerdyakov>
OK. Are you asking what is the type ofa reference to an array?
<
mellum>
Still doesn't make a lot of sense to pass a reference to an array.
<
ita>
i'm trying to do it in another way :-/
<
Smerdyakov>
Whatever you're doing, you're not saying enough about it for us to understand what you're asking.
<
ita>
and if I actually wanted to operate on an array, how would my function declaration look like ?
<
ita>
on a reference to an array
<
Smerdyakov>
That question doesn't make sense to me.
<
mattam>
f : 'a array ref -> unit
<
ita>
i have a reference to an array, and i want to print the array ?
<
mattam>
note that it is rarely a good sign of program cleanness when you write such a thing in ocaml
<
ita>
looks like what i am looking for
<
Smerdyakov>
But you don't need an 'a array ref to print it. You just need an 'a array.
<
Smerdyakov>
ita, do you understand that arrays are mutable in OCaml?
<
ita>
Smerdyakov: yes
<
Smerdyakov>
ita, you don't need to wrap them in refs to get imperative behavior.
<
Demitar>
ita, Array.iter print_string !my_array ?
<
ita>
i use a constraint programming library .. not my fault if it won't give me the solution as an array :-/
<
Smerdyakov>
ita, the library returns an 'a array ref to you?
<
ita>
Smerdyakov: yes, during the search process
<
Smerdyakov>
I don't know what "the search process" is, but OK.
<
ita>
Smerdyakov: you're talking like a parser - do you do that on purpose ? :)
<
Smerdyakov>
ita, I'm talking in a way to appropriately counteract your ambiguity.
<
Smerdyakov>
As long as you realize that, in C terms, an 'a array ref is a pointer to a pointer to a sequence of 'a's in memory, then we're fine. :)
<
ita>
i got it finally !
<
mellum>
I still fail to see the sense in returning or passing an object of that type. In rare cases it might be useful as local variable, though.
<
ita>
Smerdyakov: i am writing this on a post-it that i'll keep all my life on my screen
<
Smerdyakov>
ita, I think you are trying to be rude now. :P
<
ita>
nope, i'm too happy my program works
<
ita>
finally i start to understand how it works
__DL__ has quit [Remote closed the connection]
<
Defcon7>
'ita' has something to do with "italian" ?
<
Defcon7>
are you italian ?
<
Defcon7>
hmm .fr seems not
<
Smerdyakov>
Haha. Everyone knows Italians can't code!
<
ita>
Defcon7: no :)
<
Defcon7>
thank you Smerdyakov
<
Defcon7>
i'am italian.
<
Smerdyakov>
Everyone knows Defcon7 can't code!
<
Defcon7>
how stupid you are
<
Smerdyakov>
I don't know, how stupid?
<
Defcon7>
haha you know that the first part of your nick means "shit" in italian ?
<
Defcon7>
search on babelfish "merda"
<
mellum>
what does the second part mean?
<
Defcon7>
his nick means like something that has shit on
<
Smerdyakov>
It's a famous name from a famous book.
<
Defcon7>
bothering an italian with a nickname like "Smerdyakov" is really stupid :P
<
Defcon7>
it is like to see:
<
Defcon7>
<iamstupid> you are stupid.
<
mattam>
Smerdyakov: which book ?
<
Smerdyakov>
mattam, you can find it on the web. :)
<
Smerdyakov>
Defcon7, anyway, I was just joking. I guess that won't come across too well across a language barrier. ;)
<
mattam>
I know it reminded me of some character
<
mellum>
Smerdyakov: interestingly, the first google hit for "Smerdyakov" is for you :)
<
mattam>
is it the 'staretz' in karamazov's brothers ?
<
Smerdyakov>
I don't know what a
<
Smerdyakov>
'staretz' is, but that's the book.
<
mattam>
something like a priest
<
mattam>
the fourth children or fedor !!!
<
mattam>
child maybe ?
<
Smerdyakov>
Smerdyakov was not the religious one. That was Alyosha.
<
mattam>
i thought it was alyosha's mentor first
<
mattam>
i do not remember fedor had 4 children
<
Smerdyakov>
He had 3 legitimate children and one illegitimate, Smerdyakov.
<
mattam>
yeah i remember now, reading a 'passage'
<
mattam>
very good choice indeed
maihem has quit ["Client exiting"]
lus|wazze has quit ["If we don't believe in freedom of expression for people we despise, we don't believe in it at all -- Noam Chomsky"]
buggs|afk has joined #ocaml