<dan2>
^ wondering whether its worth changing to objects
<dan2>
neale: functors scale better tho
<Riastradh>
Functors are purely compile-time entities. Classes are instantiated at run-time.
<Riastradh>
Functors are for organization of modules; classes are for certain types of & a specific pattern of organization of data.
<neale>
hmm, time to expirement.
<dan2>
functors are like C++ templates
<dan2>
Riastradh: do you concur?
<Riastradh>
C++ templates are a poor imitation for a combination of macros, parametric modules (functors), & parametric polymorphism.
<neale>
sadly, that clarifies a lot for me
<neale>
and now I'm back to being confused :)
<dan2>
Riastradh: right, but I was using it to talk about the compile time entities
<Riastradh>
neale, this is a lot simpler than you're probably making it in your head.
<neale>
but doesnt' the Map module use functors?
<Riastradh>
Structures are just single modules. They contain a bunch of code and export a set of names. That set of names is represented by signatures.
<Riastradh>
Structures & signatures exist only to organize your code to present it to the compiler.
<Riastradh>
Functors are sort of like functions that map structures to structures. However, functors are unlike functions in that they, like structures, also exist only statically.
<neale>
okay, so I want to define a set of functions for operating on files under revision control. I want to "initialize" the whole set of functions so that I'm not required to keep providing a path name, or password to the version control server
<neale>
in my mind that calls for an object. Is my mind correct?
<Riastradh>
No, that just calls for dynamic state, or dynamically scoped resources.
<neale>
so I don't want objects, and since functors are static, I don't want those either
<neale>
but I'm not sure what other options are available to me :)
<Riastradh>
A global variable whose value is a ref.
<vincenz>
Any functions to get current date?
<vincenz>
and preferably print it
<neale>
vincenz: in the Unix module
<vincenz>
thx
<vincenz>
anyone know the line that is required in html?
<vincenz>
I mean before the html
<vincenz>
in the reply
<neale>
come again?+
<vincenz>
nm
<vincenz>
what is the asciinumber of \r?
<Riastradh>
13
<dan2>
\013
<vincenz>
thx
<neale>
\013 is a vertical tab
<dan2>
neale: I don't think so
<dan2>
neale: anway, `ascii' is your friend
cjohnson has quit ["The main attraction: distraction"]
<dan2>
neale: ascii '\r'
<neale>
\013 usually implies octal
<neale>
13 in octal is 15 in decimal
<neale>
decimal 15 is a vertical tab, at least according to this man page I'm looking at
<neale>
gotta run, thanks for the help dan2 and Riastradh
* neale
&
wam has quit [Read error: 110 (Connection timed out)]
monochrom has quit ["Few people understand "understanding"."]
smkl has quit [Read error: 238 (Connection timed out)]
smkl has joined #ocaml
rnooner has joined #ocaml
slashvar1lri] has joined #ocaml
slashvar[lri] has quit [Read error: 104 (Connection reset by peer)]
xqw has joined #ocaml
KrispyKringle has joined #ocaml
KrispyKr1ngle has joined #ocaml
KrispyKringle has quit [Read error: 60 (Operation timed out)]
KrispyKr1ngle is now known as KrispyKringle
m3ga has joined #ocaml
m3ga has quit [Client Quit]
mlh has quit [Client Quit]
rnooner has quit []
vezenchio has joined #ocaml
KrispyKr1ngle has joined #ocaml
KrispyKringle has quit [Nick collision from services.]
KrispyKr1ngle is now known as krispykringle
pango has quit ["brb"]
stef has quit [Nick collision from services.]
stef_ has joined #ocaml
pango has joined #ocaml
krispykr1ngle has joined #ocaml
krispykringle has quit [Nick collision from services.]
krispykr1ngle is now known as krispykringle
sproctor has left #ocaml []
solarwind has quit [Read error: 60 (Operation timed out)]
solarwind has joined #ocaml
krispykringle has quit ["leaving"]
Herrchen has joined #ocaml
mlh has joined #ocaml
smimou has joined #ocaml
smkl has quit [Read error: 238 (Connection timed out)]
kinners has joined #ocaml
kinners has quit ["leaving"]
smkl has joined #ocaml
tintin has quit [Read error: 54 (Connection reset by peer)]
smkl has quit [Read error: 238 (Connection timed out)]
mlh has quit [Client Quit]
smkl has joined #ocaml
bzzbzz has joined #ocaml
kdka has joined #ocaml
CosmicRay has joined #ocaml
Hanji has quit [Read error: 110 (Connection timed out)]
kdka has quit []
Hanji has joined #ocaml
CosmicRay has quit [Remote closed the connection]
drewr has joined #ocaml
rnooner has joined #ocaml
CosmicRay has joined #ocaml
CosmicRay_ has joined #ocaml
rnooner has quit []
CosmicRay_ has quit [Client Quit]
rnooner has joined #ocaml
smkl has quit [Read error: 238 (Connection timed out)]
<neale>
I really don't like yahoo groups.
<drewr>
No shite.
mrvn has joined #ocaml
mrvn_ has quit [Read error: 110 (Connection timed out)]
KrispyKringle has joined #ocaml
HOm4r has joined #ocaml
<KrispyKringle>
hi. I just wanted to ask, since I'm reading up on ocaml a bit, am I correct in thinking that one cannot have circular dependencies between modules (since object files can only be linked to those before them in the linker call)?
<KrispyKringle>
thanks.
<smimou>
recursive modules were introduced recently I think
<KrispyKringle>
ok, maybe what i'm reading is out of date.
<KrispyKringle>
it claims that each module in the link line can only refer to the modules before it, which would seem to mean that modules cannot be circularly dependent.
<KrispyKringle>
hmm. but this seems to be discussing modules that are *self* referential, if I'm not mistaken.
<KrispyKringle>
then again, i may be.
<Smerdyakov>
You are. Normal modules can already refer to themselves, by using recursive let's in their definitions.
<KrispyKringle>
"by allowing the defining module-expr and the module-type to refer recursively to the module identifiers being defined" <- that's not the behavior I was referring to, though. I was referring to a module A that uses a module B, while B uses module A.
<KrispyKringle>
this would seem to be a linking problem.
<smimou>
it isn't when modules are declarated in the same file
<smimou>
(see the link above)
<KrispyKringle>
ah.
<KrispyKringle>
ok. that's what i was curious about.
<KrispyKringle>
thanks for the help.
pango has quit ["Leaving"]
rnooner has quit []
pango has joined #ocaml
smkl has joined #ocaml
neale has quit [Remote closed the connection]
neale has joined #ocaml
monochrom has joined #ocaml
drewr has quit ["errands"]
gim has joined #ocaml
smkl has quit [Read error: 238 (Connection timed out)]
monochrom has quit [Remote closed the connection]
neale has quit [Remote closed the connection]
<dan2>
does the Marshal module use the same byte ordering on every architechture?
<pango>
The format for the byte sequences
<pango>
is compatible across all machines for a given version of Objective Caml.
<pango>
(marshal.mli)
<dan2>
pango: cool
smkl has joined #ocaml
<dan2>
pango: is it possible to do functoring by files
<dan2>
pango: like .mli and .ml
<pango>
not sure what you mean
<pango>
nor what the answer should look like ;)
<dan2>
well...
<dan2>
modules can be a .ml with a .mli
<dan2>
well, can I functor that
neale has joined #ocaml
<Smerdyakov>
You haven't given any more information on what your question is.
<Smerdyakov>
But I bet the answer is no.
<neale>
oh, okay
<neale>
well, I was going to ask if I could have another chocolate chip cookie.
<dan2>
out of curiousity
<dan2>
does the module Unix exist on windows
<pango>
yes
<dan2>
neat
<neale>
:)
<dan2>
so that makes this code really portable doesn't it :)
<Smerdyakov>
If you're willing to require Cygwin.
<dan2>
ugh
vezenchio has quit ["haibane · renmei"]
<dan2>
all the functions in Unix are specified under posix
<neale>
the windows world is really quite different from unix
<dan2>
yakker: why don't you create a type for your tuple
<Riastradh>
let f arg1 (arg2, arg3) = ...
<dan2>
yakker: type tuple = 'a * 'b
<dan2>
:)
<yakker>
dan2: because i'm using it only once...
<yakker>
Riastradh: thx. wonder why it gives me an error if i try to type the two elemts in the tuple like i did
<Riastradh>
It is not very common to write out the types of functions' arguments in the definition of the function itself.
<pango>
let f (arg1: type1) ((arg2: type2), (arg3: type3)) = ...
<pango>
or let f (arg1: type1) ((arg2, arg3) : type2 * type3) = ...
swarm has joined #ocaml
<pango>
but just check that ocaml correctly types your function, and forget all that dead weight ;)
drewr has joined #ocaml
<yakker>
pango: thanks. that works. i leave the types for readability, since i have a ton of them.
<pango>
in you need types for readability, maybe you badly choose your identifiers
<Smerdyakov>
Or maybe you badly chose your decomposition of your program into pieces.
Hanji has quit [Read error: 104 (Connection reset by peer)]
Hanji has joined #ocaml
bzzbzz has quit ["leaving"]
<yakker>
pango: true, bad identifiers:) but also because i have several tiers of information, and it's not always clear which one i'm to use as argument.
<yakker>
Smerdyakov: don't understand
CosmicRay has joined #ocaml
<Smerdyakov>
yakker, maybe when you're older
mlh has joined #ocaml
mlh has quit [Client Quit]
swarm has quit []
gim has quit []
<yakker>
Smerdyakov: merry xmas to you too 8)
<Smerdyakov>
yakker, and bless our telephones!
smkl has quit [Read error: 238 (Connection timed out)]