Re: true/false atoms?
- Posted by Roderick Jackson <rjackson at CSIWEB.COM> Aug 13, 1999
- 544 views
Kat wrote: >Ok, all that's nice, but all that stuff is just why i was trying out >Euphoria, to get away from restrictions in pascal, etc. I have written more >code than actual program to do type translations, mapping one var on top of >another and other tricks so i could use the var how i wanted to, making sure >if i deallocated the one var that all those others mapped onto it were also >not used again, etc etc. I figure the puter is here to make my life easier >and do what i want, it's not here so i can learn new programming methods or >tricks and put restrictions on what i can do. If i want to have the flag >accessed by another program or passed to another procedure/function, strings >(or sequences) are the least likely to trigger a type error (just type >everything as a string(oops, sequence)) , and i can set them to anything, >and parse what i want out of them as needed. If that's what you're looking for, why not just use the "object" type? Define all of your parameters and variables as type object, then you can send in strings, integers, or anything else you want. You would really have no trouble defining every routine in your program like: function TheFunction (object Param) object RetValue -- use Param anyway you want... return RetObject end function A single parameter of type object, that can be anything you want... an integer, a sequence of several values, a string expression, etc. Then just leave out all type declarations, and you're pretty close to a typeless program. You'll still need specific types for a lot of Euphoria functions, but many of them work just as well on sequences as on atoms. Rod