Re: type test broken
- Posted by "Kat" <gertie at visionsix.com> Jul 11, 2005
- 543 views
On 11 Jul 2005, at 3:49, Matt Lewis wrote: > > > posted by: Matt Lewis <matthewwalkerlewis at gmail.com> > > Kat wrote: > > > > I am feeding a sequence to some code: > > > > }}} <eucode> > > data = parse("AbCdEF",{"si",'c'}) > > > > global function parse(sequence s, object c) > > > > if sequence(c) then > > str = 0 -- this is executed > > end if > > > > if atom(c) > > then > > --code -- not executed > > else > > -- code -- not executed > > end if > > </eucode> {{{ > > > > So why won't the "if atom(c)... else" code execute? > > > > Could you post the full function (or at least a full demo that exhibits this > behavior)? I've done stuff like this, and found I overlooked a return or > something, or had incorrectly nested if statements. I added the "if sequence(c)" to strtok-v2-1.e while trying to find why calling parse() didn't work properly. I called thusly:
include get.e -- for wait_key() include wildcard.e -- for upper() include Strtok-v2-2.e include file.e with trace object junk, data, writefile trace(1) data = parse("AbCdEF",{"si",'c'}) writefile = open("H:\\DataMinerCode\\minenews\\newgetter-wget\\wget\\tmp2- parsed.txt","w") for loop = 1 to length(data) do puts(writefile,data[loop]&"\n==================================== ====================================\n") end for close(writefile) --junk = wait_key()
I have since rebooted the machine, no joy. I also tried the interpreter in several project directories, in case one of them had been corrupted, no joy. I also tried both exw.exe and exw40.exe, no joy. Kat