1. type question
- Posted by gertie at visionsix.com Feb 09, 2003
- 391 views
problem: gettok(string,"3",32) what type is "3" ? Sequence, yeas? global function gettok(sequence text, object n, object separator) fails the integer(n) test junk = n[1] -- junk = 51 fails the sequence(n) test fails the sequence(n[1]) test can be subdivided into n[1] passes the atom(n) test -- = 51 debug says n={51-3} -- sequence debug says junk = 51 -- atom What happened to the "3" in n ? It is acting like i used a '3' ! Kat
2. Re: type question
- Posted by Derek Parnell <ddparnell at bigpond.com> Feb 09, 2003
- 401 views
----- Original Message ----- From: <gertie at visionsix.com> To: "EUforum" <EUforum at topica.com> Subject: type question > > problem: > > gettok(string,"3",32) > > what type is "3" ? Sequence, yeas? > > global function gettok(sequence text, object n, object separator) > > fails the integer(n) test This is correct. integer(n) should return false. > junk = n[1] -- junk = 51 This is correct. The character '3' is ASCII 51. > fails the sequence(n) test What? Does sequence(n) return zero? > fails the sequence(n[1]) test Good. n[1] is an integer - 51. Also known as character '3'. > can be subdivided into n[1] Of course - its a sequence. > passes the atom(n) test -- = 51 What? Does atom(n) return true? > > debug says n={51-3} -- sequence WHat? I don't know what you mean by the 51-3. Do you mean 51 minus 3 as the value of the only element in a sequence? > debug says junk = 51 -- atom Correct. > What happened to the "3" in n ? It is acting like i used a '3' ! You did use a '3'. EUphoria's string notation is a shorthand for this... "3" is equivilent to {'3'} Just as "Derek" is the same as {'D', 'e', 'r', 'e', 'k'} ---------------- cheers, Derek Parnell