Yurik changed the topic of #ocaml to: http://icfpcontest.cse.ogi.edu/ -- OCaml wins | http://www.ocaml.org/ | http://caml.inria.fr/oreilly-book/ | http://icfp2002.cs.brown.edu/ | SWIG now supports OCaml| Early releases of OCamlBDB and OCamlGettext are available
mattam_ is now known as mattam
sambao has quit []
mattam has quit ["zZz"]
systems has joined #ocaml
TachYon has joined #ocaml
systems has quit ["Client Exiting"]
TachYon has quit [Remote closed the connection]
Sonarman has joined #ocaml
<Yurik> Sonarman: hi
<Sonarman> hello
lament has joined #ocaml
sambao has joined #ocaml
<sambao> hi
<sambao> i'm back again
<sambao> is anyone here?
<sambao> anyone willing to answer some of my questions again?
<whee> perhaps
<sambao> lol
<sambao> i think mrvn, got a little frustrated with me earlier
<sambao> sorry
<sambao> im just wondering, are variables, applications, and functions the only possible terms to have free variables
<sambao> conditionals and let doesn't have free variables right?
* whee has no idea
<sambao> oh
<sambao> that's ok, me neither
lament is now known as kgkjx
<sambao> hello guys?
<sambao> how can i remove a string from a list?
<sambao> i have a function diff that checks for the difference in two lists, but it doesn't seem to work on string lists
<sambao> but it will work on all other lists
<whee> what are you using to compare elements?
<sambao> lists
<sambao> diff [1;2;3] [3;4;5];;
<sambao> returns int list = [1; 2]
<whee> right, but how does diff do comparisons
<whee> = or ==?
<whee> I believe you need = for strings
<sambao> it matches it with a list first of course
<sambao> oh
<sambao> that could be it
<sambao> hold on
<sambao> thanks whee
<sambao> that was it
<sambao> i was using ==
Sonarman has quit ["Lost terminal"]
Sonarman has joined #ocaml
<sambao> does anyone in here know about freevariables?
<AaronWL> respectable people pay for their variables.
<sambao> lol
<sambao> i think you're thinking of vowels
<sambao> those you have to buy
<Riastradh> I am not a Church numeral, I am a free variable!
<sambao> so can anyone answer a simple questions about free variables?
<Riastradh> Possibly.
<kgkjx> yes.
<kgkjx> they're free
<Riastradh> Ask your question.
<kgkjx> and variable
<Riastradh> Then we'll see if we can answer.
<kgkjx> ask your question. Then Riastradh will see if he can answer, and I will answer.
<Riastradh> Zigackly.
<sambao> lol
<sambao> i was just wondering if i write a function freevar, do i need to have it match with let?
<sambao> i'm pretty sure it's just variables, functions, and applications
<Riastradh> 'match' it with let?
<sambao> because i'm having trouble coming up with an example for let
<sambao> yeah like is there a free variable in: "let x = (function y -> w) in (function x -> xz)"
<Riastradh> In 'function x -> xz', yes -- 'xz'.
<sambao> no, x would be bound
<Riastradh> But 'xz' isn't.
<sambao> oops, my bad
<Riastradh> Or was that a typo?
<sambao> i mean function x -> x z
<Riastradh> In that case, 'z' is a free variable.
<sambao> would w?
<Riastradh> w too.
<Riastradh> Actually, that statement is rather silly, since the 'x' bound with let is shadowed by the second function, and there's no more context in which 'x' is bound to 'function y -> w'.
<sambao> yeah, that was just my bad coming up with a bad example
<sambao> what about something like if x then y else z
<sambao> are x y and z freevars?
<Riastradh> Yes.
<sambao> really?
<Riastradh> Yes.
kgkjx is now known as lament
<sambao> I was given the definition that freevar only applies to ex: x; function(x -> y); and (function (x -> y)) (function (a -> b))
<sambao> variables; functions; and function applications
<Riastradh> Er, your example is a bit confusing.
<Riastradh> In: let f x = y;; (* y is a free variable there -- it's defined outside the definition of f. Make sense? *)
<sambao> yeah
<sambao> my example sucks
lament has quit [Remote closed the connection]
AaronWL has quit ["i love you."]
karryall has quit [Read error: 60 (Operation timed out)]
TimFreeman has joined #ocaml
TimFreeman has left #ocaml []
lament has joined #ocaml
Sonarman has quit ["bye!"]
mattam has joined #ocaml
sambao has quit []
mattam_ has joined #ocaml
mattam has quit [Read error: 60 (Operation timed out)]
lament has quit ["Did you know that God's name is ERIS, and that He is a girl?"]
<pattern_> let double x =
<pattern_> let doubled = x * 2 in
<pattern_> if ( doubled > 10 ) then
<pattern_> ( doubled mod 10 ) + ( doubled / 10 )
<pattern_> line 3, characters 8-82: This expression has type unit but is here used with type int
<pattern_> why isn't this legal?
musasabi has quit [adams.freenode.net irc.freenode.net]
musasabi has joined #ocaml
<pattern_> aaaah!
<pattern_> i didn't have an "else" clause
<pattern_> :P
<mrvn> /. +. *. 10.
<mrvn> ?
<pattern_> i just didn't have an "else", mrvn
<mrvn> orget it, you mean double as in twice and not as in float.
<pattern_> yes
<mrvn> Just woke up.
<pattern_> hehe
<mrvn> PFC 12 is on
<mrvn> you should enter
<pattern_> is it on the main kuro5in page?
<pattern_> groovy
<pattern_> actually, this isn't the best time for me as far as spare time goes... but i just might give it a shot anyway
<pattern_> i have to get this luhn's formula implementation working first, though
<pattern_> how do i work long integers? say... 16 digits long?
<mrvn> use normal ints and define +!, -!, *! that limit them to 16 Bit.
<mrvn> or make your own type
<mrvn> 16 bit are short integers.
<mrvn> long integers >64 Bit would call fo the gmp lib
<pattern_> no, not 16 bits
<pattern_> 16 base-10 digits
<mrvn> well then eigther Array or gmp library
<pattern_> mmm
<pattern_> i'll see if i can use array, because i want to use just the standard ocaml library
<mrvn> Chapter 22 The num library: arbitrary-precision rational arithmetic
<pattern_> thanks, mrvn... i'll check that out
<mrvn> If you want to write a decimal calculator you might have to write your own though. binary calculators don't have 0.1+0.1=0.2
<pattern_> no, i'm not writing a calculator... i'm having a go at implementing luhn's formula http://www.webreference.com/programming/carts/chap7/3/
<pattern_> it's nice and elegant for normal integers... but now i have to do something about these long integers
<mrvn> you have a list or array of integers there
<pattern_> well, i already had it implemented using "number mod 10", etc
<pattern_> definately could do it with a list, but i'll have to reimplement
<pattern_> no biggy, though
<pattern_> here's one ocaml implementation http://www.kode-fu.com/geek/2002_10_27_archive.shtml#85613126
<pattern_> i thought i could do better, _without_ converting the number to a list
<mrvn> works in lots of ways
<pattern_> but i didn't count on having the number overflow my integer (as i was just testing with a 4-digit number)
<pattern_> i think this guy's implementation is better anyway, as he uses a "toggle" variable in one recursive function, where as i seperated my code in to two functions: even/odd
<pattern_> but it was fun trying
<pattern_> now i guess i'll check out what the pfc is about :)
<pattern_> didn't an earlier ifpc use a crossword puzzle for its problem?
<mrvn> dunno
docelic|sleepo has quit [Read error: 60 (Operation timed out)]
<pattern_> oh, i guess i was thinking of another pfc that did anagrams, not crosswords
<pattern_> hmm... i think this is too huge a problem to tackle for me right now
<pattern_> i can just see spending tons of time developing a good algorithm
<pattern_> and what i really need to concentrate on is just learning and practicing ocaml
<pattern_> but it does look like fun
systems has joined #ocaml
docelic|sleepo has joined #ocaml
rox has quit [Read error: 60 (Operation timed out)]
systems has quit [Read error: 60 (Operation timed out)]
systems has joined #ocaml
systems has quit ["Client Exiting"]
rox has joined #ocaml
TachYon26 has joined #ocaml
TachYon26 has quit ["bez ki³y nie ma zaliczenia (z prawd studentek AM)"]
zack has joined #ocaml
zack has left #ocaml []
pattern_ has quit [adams.freenode.net irc.freenode.net]
pattern_ has joined #ocaml
pattern_ has quit [adams.freenode.net irc.freenode.net]
pattern_ has joined #ocaml
pattern_ has quit [adams.freenode.net irc.freenode.net]
pattern_ has joined #ocaml
systems has joined #ocaml
systems has quit [Killed (NickServ (Nickname Enforcement))]
docelic|sleepo is now known as docelic|away
pattern_ has quit [adams.freenode.net irc.freenode.net]
pattern_ has joined #ocaml
mattam_ has quit ["rack -> pc"]
mattam has joined #ocaml
mrvn_ has joined #ocaml
mrvn has quit [Killed (NickServ (Ghost: mrvn_!mrvn@p50834BFC.dip.t-dialin.net))]
mrvn_ is now known as mrvn
rc51 has left #ocaml []
mattam_ has joined #ocaml
mattam has quit [Read error: 110 (Connection timed out)]
systems has joined #ocaml