Re: Homogeneous sequence
- Posted by Jason Gade <jaygade at yah?o?com> Aug 14, 2007
- 666 views
CChris wrote: > It is NOT a joke. Euphoria's verbosity is already pretty high, and code > becomes > rapidly hard to read with all those wordy stuff and long significative > identifiers. > Only proper spacing makes it tolerable, but then you bump rapidly into line > length issues, since the display is not extensible. The idea is to fight > visual > clutter, the average level of which is dangerously high. Obviously we disagree on that as well. I think that Euphoria's verbosity is "just right". Neither too long nor too short. I find it to be very readable. > > Since we use {...} to denote a sequence of what's between the braces, it is > pretty intuitive to put a type mark there instead of actual values to mean > that > the sequence is made of elements of such a type. > > But perhaps you don't like indicating sequence contents with braces? Yeah, on the RHS. Not the LHS. I find your example above practically unreadable. > > This is a frequent case, but by no means the only one: > Is a string made of printable characters only? > Are all the characters in some Unicode range, else change font? > Are all records of the list the same length? (Juergen's initial concern) > Do all records verify some consistency check, like > s[i][DATE_START]<s[i][DATE_END] > \forall i? > > And countless many other cases, which would be coded much more neatly than > they > now are. Of course, direct type checks are costly, but flagging homogeneous > sequences would speed up a lot of things by allowing incremental type > checking, > as emphasized earlier in the thread. > > CChris Then write a function or a type to do it! It's not that hard. I think you focus too much on the performance issues. Are we all still running at 33MHz or what? Anyway, as I said elsewhere in the thread, I liked Pete's idea of limiting it to new type definitions. That may also increase the usage of a well-designed but under-used language feature. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j.