dan2 changed the topic of #ocaml to: OCaml 3.08.2 available! | Archive of Caml Weekly News: http://sardes.inrialpes.fr/~aschmitt/cwn/ | A tutorial: http://merjis.com/richj/computers/ocaml/tutorial/ | A free book: http://cristal.inria.fr/~remy/cours/appsem/ | Mailing List: http://caml.inria.fr/bin/wilma/caml-list/ | Cookbook: http://pleac.sourceforge.net/
wam has quit ["Abandonando"]
wam has joined #ocaml
mlh has quit [Client Quit]
CosmicRay has joined #ocaml
m3ga has joined #ocaml
m3ga has quit ["Client exiting"]
monochrom has joined #ocaml
dan2 has joined #ocaml
sproctor has joined #ocaml
<neale> anyone around now?
<Riastradh> No.
fab__ has quit [Read error: 60 (Operation timed out)]
<neale> shucks.
<neale> okay, I have nailed this down to a simple example
<neale> can anyone explain to me the type error when trying to run http://woozle.org/~neale/tmp/foo.ml?
mlh has joined #ocaml
fab__ has joined #ocaml
hangman4 has quit [Connection timed out]
vincenz has quit ["leaving"]
CosmicRay has quit [Remote closed the connection]
vincenz has joined #ocaml
<vincenz> Any plans on making str thread-safe?
<monochrom> neale: it may help to write let bar (g:grape) =
<neale> yes, that's what I've done, but is that the "right" solution?
<neale> Caml seems so good at type inference, it feels like cheating to give it hints like that :)
<monochrom> but objects make type inference harder. and optional parameters don't help.
<neale> very true.
<neale> perhaps I should try to use a functor.
<dan2> I try to avoid the ocaml object system
<dan2> I find there is nothing it can do that I can't do with regular modules
<neale> there does seem to be a good deal of overlap between objects and structs.
<dan2> however, at times classes may reduce complexity
<dan2> most often in cases where you would give the user three or so abstr values
<dan2> it'd be much easier to not have to ask for them if every function requires at least one of them
<neale> actually, classes and functors seem to be almost identical. I must be missing something.
<dan2> they are near identical
<dan2> but I'd prefer classes over functors
<dan2> I think functor syntax is goofy
<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.
HOm4r has quit [Remote closed the connection]
<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
<neale> windows, for instance, does not have fork.
<dan2> thus any posix compliant operating system should have the functions
<dan2> win2k and winxp are supposedly posix compliant
<Smerdyakov> Is there even a non-Cygwin OCaml version?
<Smerdyakov> (for Windows)
<neale> dan2: this is probably why the Unix module is not named "Posix".
<Smerdyakov> Ah, I see that there is.
<pango> dan2: they're different ways to be posix compliant. Remember you probably heard that from some marketing dept.
<dan2> pango: no it says when you open up cmd.exe
<neale> The fork call conforms to SVr4, SVID, POSIX, X/OPEN, BSD 4.3.
<neale> so, that's at least one way Windows isn't POSIX compliant.
<neale> getgid is posix too, and I'm pretty sure Windows doesn't have groups
<neale> and I'd bet money that Windows doesn't have petpwnam, specified by POSIX 1003.1-2003
<neale> getpwnam
KrispyKringle has quit ["leaving"]
CosmicRay has quit [Remote closed the connection]
<dan2> ok, from MSDN
<dan2> it says windows is compliant with posix at the time NT4.0 came out
<dan2> and since then is still compliant with only that version
<pango> dan2: there more than one level of posix compliance
<pango> dan2: so saying "it's posix compliant" is not precise enough
<pango> nor does it say that porting Unix apps to the platform will be trivial. Obviously it isn't
<dan2> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore/html/_core_port_from_unix_to_win32.asp
<dan2> unix libs for windows
<pango> yes, they say it's POSIX 1003.1 compliant
<dan2> uwin is like cygwin, but a lot lighter and faster, and it doesn't require the dependencies
<dan2> uwin built applications will run without uwin
<pango> cygwin provides more than an API layer, it also provides an environment, so you can't really compare one against the other
<pango> anyway I'm not in those things, I don't use Windows since '96
<dan2> pango: yeah, but if you are porting applications, you don't want a major environment
* dan2 hasn't used windows since '98 on any home pcs
<dan2> just thought it was entertaining that this app is portable
<pango> dan2: depends. If you rely on shell scripts, for example, it may be useful
<dan2> uwin provides the korn shell
<pango> don't know then
<dan2> pango: I mean, if I loaded mingw and uwin
<dan2> I could probably build ocaml without changes
<pango> seems there's licensing issues with uwin
<dan2> pango: as of may 7th they no longer support it says the companies messages
<dan2> pango: so they stop selling licenses of it
<dan2> pango: someone should email them and see what their policy is on it for a dependency
<dan2> pango: tho, aren't you able to build binaries in cygwin that don't require cygwin, with -mno-cygwin
<dan2> pango: probably means in any case that cygwin is statically linked n
yakker has joined #ocaml
monochrom has joined #ocaml
<yakker> how does one type a function that accepts a heterogeneous tuple as one of its arguments?
<yakker> eg. let func (arg1: type1) (arg2:type2, arg3: type3) = ?
<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)]
mlh has joined #ocaml
<neale> telephones?
<Smerdyakov> I am have said a NONSENSE!
<neale> you're making my head hurt.