zyrnix has joined #ocaml
indigo has quit ["no more irc for me until i have payed my debt"]
_jpl_ has left #ocaml []
malte has quit ["Leaving"]
photoAllergic has joined #ocaml
LittleDa1 has joined #ocaml
<
LittleDa1>
Is it possible to use modules from the toplevel?
<
LittleDa1>
no one want to answer?
<
bk_>
like in #load and #use ?
<
LittleDa1>
oh, you mean you can't use open?
<
bk_>
i think its just #use mymodule from the toplevel
<
shrimpx>
is it possible to list the signature of a module from the top level?
<
LittleDa1>
Why can't you just use open Module;;?
<
shrimpx>
LittleDa1: you can
<
LittleDa1>
What's wrong with this?:
<
LittleDa1>
# open Str;;
<
LittleDa1>
# let match_hi = Str.regexp "hi"
<
LittleDa1>
Reference to undefined global `Str'
<
LittleDa1>
I mean let match_hi = regexp "hi";;
<
LittleDa1>
same error
<
LittleDa1>
do I have to cd to the directory that the modules are stored in?
wazze has quit ["--- reality is that which, when you stop believing in it, doesn't go away ---"]
<
bk_>
# #load "str.cma" ;;
LittleDa1 has left #ocaml []
housetier has quit [Read error: 110 (Connection timed out)]
cjohnson has quit ["Drawn beyond the lines of reason"]
mof has quit [Read error: 60 (Operation timed out)]
bk_ has quit ["I'll be back"]
rt has left #ocaml []
yeoh has joined #ocaml
yeoh has left #ocaml []
Gahhh has joined #ocaml
<
Gahhh>
anybody around ?
gim has joined #ocaml
Jaundice has joined #ocaml
andrewb has quit [Read error: 104 (Connection reset by peer)]
Jaundice has quit [Read error: 54 (Connection reset by peer)]
Jaundice has joined #ocaml
andrewb has joined #ocaml
Jaundice has quit ["Leaving"]
teratorn has quit [Read error: 60 (Operation timed out)]
shrimpx has quit [Remote closed the connection]
photoAllergic has quit ["Leaving"]
shrimpx has joined #ocaml
shrimpx has quit [Remote closed the connection]
shrimpx has joined #ocaml
Gahhh has quit ["Leaving"]
shrimpx has quit [Remote closed the connection]
shrimpx has joined #ocaml
zyrnix has quit ["gone"]
mij has quit [kornbluth.freenode.net irc.freenode.net]
hf has quit [kornbluth.freenode.net irc.freenode.net]
lam has quit [kornbluth.freenode.net irc.freenode.net]
themus has quit [kornbluth.freenode.net irc.freenode.net]
Demitar has quit [kornbluth.freenode.net irc.freenode.net]
rox has quit [kornbluth.freenode.net irc.freenode.net]
pattern has quit [kornbluth.freenode.net irc.freenode.net]
andrewb has quit [kornbluth.freenode.net irc.freenode.net]
Smerdyakov has quit [kornbluth.freenode.net irc.freenode.net]
mellum has quit [kornbluth.freenode.net irc.freenode.net]
yella has quit [kornbluth.freenode.net irc.freenode.net]
hf has joined #ocaml
themus has joined #ocaml
lam has joined #ocaml
mij has joined #ocaml
andrewb has joined #ocaml
Smerdyakov has joined #ocaml
rox has joined #ocaml
yella has joined #ocaml
Demitar has joined #ocaml
pattern has joined #ocaml
mellum has joined #ocaml
teratorn has joined #ocaml
reltuk has joined #ocaml
<
reltuk>
anyone around?
<
reltuk>
i'm having a bit of a time wrapping my head around doing a reverse function in CPS that doesn't take O(n^2) time...
<
reltuk>
so far I basically got:
<
reltuk>
let reverse lst k = match lst with | [] -> k [] | x::xs -> reverse xs (fun h -> k (h @ [x]))
Jaundice has joined #ocaml
<
shrimpx>
reltuk: that doesn't take O(n^2)
<
reltuk>
shrimpx: why not?
<
shrimpx>
O(n^2) basically means that you do something to the whole list for each element of the list
<
shrimpx>
your function looks linear to me..
<
reltuk>
shrimpx: right... '@' takes O(n) time, since lists are immutable and it builds a new list
<
reltuk>
I can ofcourse perform the reversal in an accumulator "on top of" the continuation, but that doesn't feel like what they're asking for
<
shrimpx>
that's still not O(n^2), since at each step, @ operates on only a portion of the list
<
shrimpx>
er nevermind
<
reltuk>
shrimpx: sure it is...for (int i = 0; i < n; ++i) { for (int j = 0; j < i; ++j) { } } <---- O ( n^2 )
<
reltuk>
not n^2 mind you...like n^2 / 2 or something...still O(n^2) though
<
reltuk>
anyway, to bed with me
reltuk has quit [Remote closed the connection]
mijdrol has joined #ocaml
mij has quit [Read error: 110 (Connection timed out)]
mijdrol is now known as mij
buggs^z has joined #ocaml
buggs has quit [Read error: 110 (Connection timed out)]
malte has joined #ocaml
mij is now known as mijdrol
yeoh has joined #ocaml
malte has quit [Read error: 54 (Connection reset by peer)]
Tachyon76 has joined #ocaml
slashvar[lri] is now known as slashvar[ens]
malte has joined #ocaml
buggs^z is now known as buggs
yeoh has quit ["User pushed the X - because it's Xtra, baby"]
Tachyon76 has quit ["Leaving"]
smimou has joined #ocaml
cjohnson has joined #ocaml
bk_ has joined #ocaml
gim has joined #ocaml
bk_ has quit ["Terminated with extreme prejudice - dircproxy 1.0.5"]
bk_ has joined #ocaml
Zoidberg is now known as zoidberg
maihem has joined #ocaml
maihem has quit ["Client exiting"]
<
malte>
try let ic = open_in "test.txt"; with Sys_error _ -> Printf.printf "File does not exist!"; <- why isnt this valid?
<
Smerdyakov>
You must have an expression between 'try' and 'with'.
<
Smerdyakov>
You don't have one.
<
Smerdyakov>
There is no expression with 'let' alone.
<
Smerdyakov>
There is always an 'in'.
<
Smerdyakov>
And as a stylistic point, those semicolons are extraneous.
<
malte>
yes, just wanted to make it clearer to my untrained eye ;)
<
Smerdyakov>
I'm a little confused as to why you thought what you pasted could possibly be valid.
<
Smerdyakov>
What did you expect it to mean/do?
mattam_ has joined #ocaml
<
malte>
Smerdyakov, ehm.. i wanted it to open the file if it existed, otherwise print an error msg and exit
Lemmi1 is now known as Lemmih
<
Smerdyakov>
But you could never close the file, so you would exhaust the limit on file handles that the OS provides if that code is in a loop.
<
Smerdyakov>
You could never do
_anything_ with the file, since the binding to 'ic' is only valid inside the 'try'.
<
malte>
heh, yes.. i just started programming ocaml :/
mattam has quit [Read error: 110 (Connection timed out)]
_jpl_ has joined #ocaml
mattam_ is now known as mattam
<
yella>
if i have a bunch of nested types, e.g. like:
<
yella>
type last = X of int|Y of string|Z of int;;
<
yella>
type second = SA of last|SB of int;;
<
yella>
type first = A of second|B of last;;
<
yella>
and a structure of say A (SA (X 10))
<
yella>
how would a function look like which takes type first as input and 'unfolds' the rest?
<
yella>
in the way that you could step by step compare two type expressions
reltuk has joined #ocaml
<
yella>
it would work fine with pattern matching if all were of the sames types
<
yella>
but like this, type inference is coming in the way
malte has quit [Read error: 104 (Connection reset by peer)]
reltuk has quit [Read error: 104 (Connection reset by peer)]
<
mattam>
you'd need to pass one function by type
<
mattam>
i.e: one for int and one for string
gim has quit [Remote closed the connection]
gim has joined #ocaml
reltuk has joined #ocaml
_JusSx_ has joined #ocaml
wazze has joined #ocaml
_jpl_ has left #ocaml []
reltuk has left #ocaml []
malte has joined #ocaml
Jondice has joined #ocaml
Jaundice has quit [Read error: 110 (Connection timed out)]
reltuk has joined #ocaml
Hipo has joined #ocaml
_JusSx_ has quit ["BitchX: it keeps going and going and going and going and..."]
det has quit [Read error: 113 (No route to host)]
det has joined #ocaml
reltuk has quit ["User disconnected"]
reltuk has joined #ocaml
Jondice has quit ["Leaving"]
reltuk has left #ocaml []
smimou has quit ["J'ai fini."]
gim has quit ["dodo..."]