<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_>
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)]