Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: Is a "series" aka an "array"

From: dukeofperl:ml1 at: 5-Nov-2010 6:40

On Fri, 5 Nov 2010, Carl Read wrote:
> On Thursday, 4-Novenber-2010 at 22:45:03 Duke Normandin wrote, > > >> As another quick example, there's a datatype called number! that both > >> integer! and decimal! fall under. > > > >I've been thinking the very same thing! But is "number" the data-type, > >or integer and decimal the data-type (as in other languages). You see? > > number! and series! are called pseudo-types to distinguish them from > the other, normal datatype.
OK! We're getting close... What is the motivation/reason for having a pseudo-type?
> >I don't see the point, e.g. using the Pascal family paradigm, of having > >LONGINT, INTEGER, SHORTINT, REAL etc, which are data-types, and giving > >them the collective name of "numbers". What would be the point? > > Well, if you're doing maths you can then check if the data is a number... > > >> integer? 7 > == true > >> integer? 7.5 > == false > >> number? 7 > == true > >> number? 7.5 > == true
Sure ... REBOL has "predicates" that asks a question about a data-type - "are you an integer?" yes or no? Are you a "real"? yes or no? But what's the point of asking, "are you a number? The question is too broad, is it not? Does asking "are you a number?" lead me down a different path than asking the question, "are you an integer?" ? Get my point? -- Duke