Re: haha very funny
- Posted by David Cuny <dcuny at LANSET.COM> Oct 21, 2001
- 365 views
euman at bellsouth.net wrote: > d = dir(current_dir()) -- this says right up front dir( ) returns a sequence doesnt it! Well, not really. It returns a sequence _if_ the routine succeeds. If not, it returns an integer. So you can write your test: object d d = dir( ... ) if integer( d ) then ... failure code else ... success code end if or use 'not sequence(d)' if you prefer. It's idiomatic to Euphoria, and shows up in a number of places. For example: while 1 do result = gets( handle ) if integer( handle ) then exit end if end while I'll grant that it's a bit odd, but it's more or less consistant. -- David Cuny