Re: Stupid Newbie-sounding question.
- Posted by Robert Craig <rds at RapidEuphoria.com> Jun 01, 2004
- 551 views
Patrick Barnes wrote: > My approach to this problem: > > We need a new keyword; "of". > Usage: > > type char ( integer c ) > -- return 1 valid character, 0 otherwise > end type > > --myStr is a string > sequence of char myStr > > It is an extension to the type checking system on sequences, and is applied > whenever an element of the sequence is changed. The existing type checks are > slow because they have applied to the whole sequence whenever a single > element is changed. This "of" typing would only check the elements that are > changed in the sequence. This idea has come up before. I haven't ruled it out. I was quite interested in this a few years ago. As I recall, the thing that made me lose some interest was the fear that few people would use it, and it wouldn't provide a great deal of benefit to those who did use it. It would also make the language more complicated, not to mention verbose. In other languages, you need types in order to define the layout of your data in memory. In Euphoria, a type is just a documentation and debugging aid, and few people seem to bother defining them. Regards, Rob Craig Rapid Deployment Software http://www.RapidEuphoria.com