<senko>
funny thing is, if you rename the method called a_text, it doesnt segfaults..
<senko>
at least not here
<senko>
but that method is not called anywhere
<senko>
*called _from_ anywhere
<senko>
heh :)
<senko>
if it has "t" in its name it segfault
<senko>
otherwise not..
<senko>
ehh...
<senko>
not true..
<senko>
but some names segfaults and some does not..
<Smerdyakov>
We know it's not supposed to segfault if you don't use wacky unsafe library functions, so there's no point in waiting to submit a bug report.
<senko>
ok..
<senko>
i have never done a bug report before..
<Smerdyakov>
BTW, why are you using OO? :)
<senko>
hmm..
<senko>
can i produce a segfault without the oo part?
<Smerdyakov>
Every line of your example is using OO, so that would have to be a completely orthogonal issue.
<senko>
:)
<senko>
it is a very reduced version of an other program..
pango__ has quit [Read error: 54 (Connection reset by peer)]
<senko>
is oo bad?
<Smerdyakov>
Yes.
<senko>
why?
<Smerdyakov>
It tends to be a bad fit for most problems.
<Smerdyakov>
People coming from other languages often use it as the default structuring principle.
<Smerdyakov>
Instead, you should think about which OCaml feature actually makes the most sense.
<senko>
well.. i use it like some sort of struct...
<senko>
i dont use inherit much
<Smerdyakov>
If that's all, then you should be using records instead.
<senko>
mmm...
<Smerdyakov>
If you are using OO to structure code on a large scale, you should probably be using the module system instead.
<senko>
i usualy have one class per module..
<senko>
:)
<senko>
and not much else
<Smerdyakov>
I usually have zero classes per project.
* Msandin
thinks OO is fine, but knowing other ways is always a good things...
<Smerdyakov>
Msandin, it's not "fine" to use it as the default for everything you implement, a la Java.
* TeXitoi
have to learn ocaml oo to know modules are great ;-)
<Msandin>
And furthermore, that "large scale" is the correct scale for OO ;-p
<Smerdyakov>
ML-style module systems work much better than OO for structuring large bodies of code, in almost all cases.
* Msandin
believes OO is more useful for programing structuring than domaing modelling, which is how it's usually sold...
<Smerdyakov>
And module systems are much _more_ useful for that....
<Msandin>
Smerd: I don't automatically buy that I don't;)
pango has joined #ocaml
<Smerdyakov>
It's pretty obvious, since module systems are more general than OO for these structuring purposes.
<Smerdyakov>
You can do more, and you have fewer unrelated notions forced on you for every use of a feature.
<Smerdyakov>
Like not being able to avoid dynamic dispatch.
<Msandin>
Not really. They are different beats.
<Smerdyakov>
On a superficial syntactic level, they are different. The real, useful services they provide are very similar, and ML modules provide a superset of the features OO provides, more or less.
<Smerdyakov>
ML modules provide everything but dynamic dispatch and inheritance from OO, I'd say.
<Smerdyakov>
And these can be implemented orthogonally.
<Msandin>
Except OCaml modules don't actually provide dd, which is unavoidable (inheritance isn't a cult i subscribe to)
<Smerdyakov>
Yes, and I think dynamic dispatch is overused and relatively unimportant.
<Smerdyakov>
First-class functions let you do it better.
<Msandin>
Let's not confuse what can be implemented and what convinient
<Smerdyakov>
Oh, I'm not.
<Smerdyakov>
What I'm saying is: If you describe a serious benefit of OO design for large chunks of code, I can tell you how to get the same effect (likely more effectively) with ML modules.
<Smerdyakov>
It's not allowed to describe effects that are too tied to particular language features.
<Msandin>
Smerd: That's the point I'd argue, that first class functions are a good way of achieving dd on large scale. I will certainly not argue it on the small scale though:)
<Msandin>
Smerd: I need to leave, thanks though=)
<Msandin>
(I do think that OO's main achievement might be as a way of managing namespaces however, which Haskell type classes does decently as well, but which is heavy-handed to do in modules:)
Msandin has quit ["Thank!:-)"]
<mflux>
I too do feel that the fact that oo binds the value to a certain namespace of functions is quite convenient at times; it reduces repeating the module names, or alternatively importing the modules to your namespace
<mflux>
although the openin-pp-hack can often overcome that issue, which only leaves convenient dynamic dispatch to oo's advantage
<TeXitoi>
what's openin-pp-hack?
<Smerdyakov>
Two "extra" characters per module member reference don't bother me, since they also bring the benefit of showing you where the value you use is defined.
<mflux>
language extension, look it up at humps
<mflux>
you mean you usually import the modules with a one-letter name?
<Smerdyakov>
I rebind them with one-letter names.
<Smerdyakov>
I don't think "import" is correct to use here.
<senko>
i do that too..
<TeXitoi>
open M in e ?
<mflux>
texitoi, that's what the extension provides, yes
<TeXitoi>
ok, thanks
<Smerdyakov>
FYI, that "extension" is in the SML Definition, and it's much better integrated with the rest of the language. ;)
<mflux>
what do you mean 'better integrated'?
<mflux>
although I wouldn't mind if ocaml had it too in the distribution
<mflux>
I feel the worst part of the 'open in' integration is that tuareg-mode doesn't understand it
<Smerdyakov>
SML has a syntactic class of "declarations," multiple of which appear between 'let' and 'in'.
<Smerdyakov>
This means there is "the 'open' declaration" instead of "the 'open..in' expression."
<Smerdyakov>
So, while OCaml has separate "'open' declaration" and "'open..in' expression," SML only has the former.
<Smerdyakov>
(While still supporting the same functionality, and potentially automatically expanding to any context where declarations are allowed.)
<mflux>
so not much actual syntactic advantage, besides that it's implemented cleaner?-o
<Smerdyakov>
There is less to learn to know everything there is to know about how to use 'open'.
<mflux>
'open Module in expr' is still quite clean and straightforward, and somewhat similar to open and let
<Smerdyakov>
Yet it's a new expression form with no formal connection to any other.
<mflux>
I don't know about you, but I must admit I didn't actually quite look at the BNF descriptions of ocaml when I was learning it
<mflux>
I have later taken a few peeks at it, though
<mflux>
does SML btw have a language extension mechanism?
<Smerdyakov>
No
mr_pengy has joined #ocaml
epichrom has joined #ocaml
Nutssh has quit [Read error: 60 (Operation timed out)]
maml has quit []
adc_ has left #ocaml []
Nutssh has joined #ocaml
senko has quit ["Leaving"]
Herrchen has quit ["good night"]
Snark has quit ["Leaving"]
Sonarman has joined #ocaml
TeXitoi has quit [Read error: 54 (Connection reset by peer)]
TeXitoi has joined #ocaml
_JusSx_ has joined #ocaml
Submarine has quit ["Leaving"]
_JusSx__ has quit [Read error: 110 (Connection timed out)]
<fck>
hey, question for the ocaml experts in here
<fck>
i have a recursive function that i want to use to compose a list of sublists... think that will work?
<Smerdyakov>
This is a question for "experts"...?
<fck>
each round a compose a list of 4 elements, and then i :: it with a call to that function again
<fck>
lol
<fck>
do you know if that will produce a list of sublists, or just one list with no separation of elements
<fck>
if that question makes sense
<Smerdyakov>
You weren't detailed enough. Why don't you write the function and see for yourself, instead of trying to use us as an interpreter?
<Smerdyakov>
You can't explain the function precisely enough without writing the code, anyway.
<fck>
b/c it has about 1000 elements, and it's going to take a while
<Smerdyakov>
Why don't you test it on smaller inputs?
<fck>
i figure a simple yes or no could help this process
<Smerdyakov>
Like I said: we can't understand you unless you give us the code.
<Smerdyakov>
If you have the code, you can test it yourself.
<fck>
just a sec
<Smerdyakov>
(This definitely doesn't mean "write the code and paste it here." You should instead do the "test it yourself" before asking for further help.)
<fck>
i see you're very busy.
<Smerdyakov>
Trust me; this works out the best for _everyone_.
<Smerdyakov>
You probably underestimate your own ability to determine that "your idea" is well-thought-out enough to uniquely determine a reasonable implementation.
<Smerdyakov>
The only way to be sure is to write the code, and then you have no need for anyone to guess if it will work, when you can just run it.
<Smerdyakov>
s/underestimate/overestimate
<Smerdyakov>
Put another way: You might be used to other languages where people describe "algorithms" with "pseudocode." Then they can ask if the "algorithm" looks correct before moving to "the implementation."
<Smerdyakov>
ML is expressive enough that you don't need a "pseudocode" stage.
<Smerdyakov>
A good enough specification of the algorithm is best coded in ML itself.
<Smerdyakov>
So you can't describe your "idea" without coding it.
<Smerdyakov>
Or, if you do describe it another way, you have wasted your time.
johnyeros has joined #ocaml
<johnyeros>
anybody here wanna help a brother out?
<johnyeros>
I have a simple problem but I can't seem to get it working properly
<Smerdyakov>
It's best to launch right into your question. People who can help and want to will respond.
<Smerdyakov>
(But don't paste more than one line of code)
<johnyeros>
thanks
<johnyeros>
I have 2 list of list (vector right) A & B, I want to take make a new list of list that has the first 2 element of each list to be first 2 element of A and the last 2 elements to be the last 2 element of B
<Smerdyakov>
Why did you say "vector right"?
<epichrom>
so you don't confuse it with "vector okay"
<Smerdyakov>
Why would you have said "vector okay"?
<epichrom>
haha
<Smerdyakov>
In other words, what is the meaning of "vector right" in your original sentence?
<johnyeros>
I'm saying it's a list of list, so it's a vector
<johnyeros>
but I don't want to use vector manipulation
<Smerdyakov>
No, that's not what "vector" means in the ML world.
<johnyeros>
I want to leave it as list of list and mess with it
<johnyeros>
ok
<johnyeros>
good
<Smerdyakov>
Is this a homework assignment?
<johnyeros>
does it matter?
<Smerdyakov>
Yes.
<Smerdyakov>
I don't want to help people cheat.
<johnyeros>
I'm just trying to use a trick to solve a more compilcated problem
<johnyeros>
you're not helping, so it doesn't matter now does it
<Smerdyakov>
From your behavior, I'm guessing it _is_ a homework assignment, and you know that it is against the course rules to ask for help on IRC.
<johnyeros>
don't be an ass, I'm just trying to find out a way to solve this simple problem
<johnyeros>
why would my homework have me compiling 2 list
<Smerdyakov>
Why wouldn't it? We don't know anything about the class.
<johnyeros>
how would you know?
<johnyeros>
I could tell you I'm writting this for my company
<johnyeros>
I could tell you I write this my dog
<johnyeros>
it's not like I'm asking you : Dude, I need a program that does this and this and this, please show me the code for it
<johnyeros>
what's the point of a help channel if all you do is harash people instead of helping
<johnyeros>
if I wanted to cheat, I would get a friend to write it for me
<Smerdyakov>
Yup. You certainly could lie. I believe that people are less willing to lie than they are to pretend that they aren't aware of the ethical issues, though.
<Smerdyakov>
Maybe someone else will help you. My policy is that I want to see a link to the official policy of the course in question before answering questions directly pertaining to homework problems.
<epichrom>
When has this become a "helping" channel?
<johnyeros>
Well from what I heard. There's an ass on this board who doesn't do anything except annoying people. I log on to see what's going on. Now I see.
<johnyeros>
/who is Smerdyakov
<Smerdyakov>
That's me.
<johnyeros>
/slap
<johnyeros>
what company do you work for?
<Smerdyakov>
I'm a graduate student.
<epichrom>
Now you're being rude, thinking you're rightful in slapping people.
<johnyeros>
this is address toward epichrom: You're being rude, nobody is talking to you. Don't butt into other people business/conversation.
<johnyeros>
the slap was a test, I'm using gaim, I want to see what irc command it support
<johnyeros>
new to this gaim as irc client junk
<epichrom>
I only promise I won't butt into a conversation you carry out in a place I don't have access to.
<Smerdyakov>
johnyeros, if you wanted to have a private conversation, you shouldn't be having it in this channel.
<johnyeros>
Oh..! you got me by a technical point!
<johnyeros>
You're so good.
<johnyeros>
I'll write some caml code for that
<johnyeros>
I'm writting this program for my company, I don't know how to add float in ocaml. Can you teach me?
<Smerdyakov>
Only if you signed this NDA.
<johnyeros>
Which NDA is this? Non-Dicking-Agreement? Non-Distribute-Agreement or Non-Disclosure-Agreement?
<Smerdyakov>
Well, I think all three would be appropriate.
<johnyeros>
I'll sign your so called NDA if you sign my SNDA and my PLD.
<Smerdyakov>
This must be a hard assignment if you spend this much time trying to avoid working on it.
<johnyeros>
so anybody want to help me to cheat. I want to learn how to add float X and float Y and then print it.
<johnyeros>
actually, I'm running my algorithm
<epichrom>
good luck.
<johnyeros>
I heard there're some bastard on the board so I'm here to test it out
<johnyeros>
while my algorithm is running
<Smerdyakov>
It's not a "board."
<johnyeros>
Sure, Mr. Right the guardian of this wonderful "channel."
<johnyeros>
Are you a TA too?
<Smerdyakov>
Yup.
<johnyeros>
I bet you're a nice person. I must meet you to dicuss about your work and ethical pov.
<johnyeros>
I want to idle on this channel too. I'm sure by tomomrow I will earn the status of being a leet ocaml programmer so I can be an ass to other incoming programmer too.
<Smerdyakov>
As far as I can tell, it's inaccurate to call you a "programmer." I better term would be "someone trying to finish his homework so he can get on with his life."
<johnyeros>
You're so right. I'm sorry
<johnyeros>
I beg you to please lend your awesome skill that I have yet seen
<johnyeros>
I was thinking. Wow, why do I want to do my homework when I can get on these channel and ask for the answer. I'm Sorry, please forgive me.
johnyeros is now known as nana
nana is now known as Dradkakov
<Dradkakov>
Now with a really cool somewhat russian name like yours, I can be awesome like you! You
<Dradkakov>
Are my role model.
<Dradkakov>
I'll be back later so we can talk more about this
<Dradkakov>
visit www.asterisk.org in your spare time, between all the free time when you're not being a dick! :-) have a nice day
<Dradkakov>
dick.
Dradkakov has left #ocaml []
* Smerdyakov
starts writing a certified Java Bytecode Verifier.
<epichrom>
arrogant open source coder
<TeXitoi>
wa... that's hot here! ;-)
<Smerdyakov>
TeXitoi, do you respond to me or epichrom?
<epichrom>
only Java is hot anywhere :)
<TeXitoi>
just thinking with my fingers ;-)
<Smerdyakov>
TeXitoi, but are you talking about Java Bytecode Verifier stuff being hot?
<TeXitoi>
no, I'm talking about johnyeros
<Smerdyakov>
Too bad. I was hoping we could have a discussion about what people in your location were working on, related to what I'm doing. :)
<TeXitoi>
nop, I'm just a futur researcher that code his project in ocaml
<TeXitoi>
sorry ;-)
<epichrom>
johnyeros is hot at your place? what does that mean?
<TeXitoi>
mmm, that's smell fight
<epichrom>
Sorry, I don't mean to fight. Honest question.
<TeXitoi>
epichrom: that what I meen by hot : that's hot <=> that smell fight
<TeXitoi>
+'s+'s
<epichrom>
Ah, now I understand!
<TeXitoi>
;-)
<epichrom>
you also say, you're coding... his project? which project is it? asterisk?
<TeXitoi>
I talk about my project
<epichrom>
oops, "his" = TeXitoi's. sorry.
<TeXitoi>
no problem ;-)
<TeXitoi>
if you prefere : I'm just (a futur researcher that code his project in ocaml) ;-)
<epichrom>
I blame all of my mischief on reading this channel in English and a web page in Chinese at the same time! The language switching confuses me! Yeah!
<TeXitoi>
lol
<TeXitoi>
I've thought that my english was so bad that you couldn't understand me...
vezenchio has quit [""Under democracy one party always devotes its chief energies to trying to prove that the other party is unfit to rule—and bot]
<epichrom>
English isn't my native either, don't worry.
<TeXitoi>
so do I ;-)
smimou has quit ["?"]
_JusSx_ has quit ["leaving"]
mr_pengy has quit ["ERC Version 5.0.1 $Revision: 1.726.2.3 $ (IRC client for Emacs)"]
<Nutssh>
TeXitoi, your english looks fairly understandable.