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

[REBOL] Re: TUPLE! DATA-MODEL & OTHER VALUES

From: carl:cybercraft at: 14-Jun-2001 12:21

On 14-Jun-01, Joel Neely wrote:
> Hi, Carl, > Let me respond to a couple of statements. I'll take them out > of order, as I suspect one to be relevant to more folks than > the other. > Carl Read wrote: >> >> On 13-Jun-01, Joel Neely wrote: >> >>> Holger Kruse wrote: >>>> >>>> Tuple: >>>> >>>> a: 1.2.3 >>>> b: a >>>> a/1: 0 ;Changes 'a only. 'a and 'b do not share data. >>>> a >>>> == 0.2.3 >>>> b >>>> == 1.2.3 >> >>> If you'll just clarify whether you meant that >> >>> "The tuple in 'a has been modified." >> >>> or >> >>> "The tuple in 'a has been replaced." >> > ... >> >> Because tuples are like integers "simple" (to use Holger's >> term)... modified seems the most likely as it'd save on >> garbage collection. >> > I *really* doubt that inference. Garbage collection applies > to dynamically allocated data structures, which are usually > managed through some variation of pointers, handles, or > references (whether automatic or not). If (e.g.) tuples are > non-reference data, it's hard for me to imagine how garbage > collection has anything to do with it.
Well, my feeling is that if you replaced the tuple, the one you replaced would be left hanging around and in need of discarding in one way or another.
>> Because tuples are like integers "simple" (to use Holger's >> term), I have a feeling the answer is that it makes not a >> jot of difference to the REBOL programmer. >> > You're certainly entitled to say that it makes no difference > to you, but others (including me) may have more of an interest.
My point is that with "simple" datatypes, REBOL could be either modifying or replacing them and we couldn't tell either way. (Except perhaps with memory usage, which could possibly differ from platform to platform.) The mental model to have though would be that they've been modified, as there's no way (as far as I know) to get at the original again.
> This thread arose from an attempt to understand the behavior > of SAME? and EQUAL? with respect to the various data types. > Understanding how the parts of our language fit (and work) > together would seem to contribute to using the language more > effectively. > There are many places where REBOL exhibits seeming subtleties and > inconsistencies. Understanding how the parts of our > language fit (and work) together would seem to help a programmer > (of any flavor ;-) avoid any unnecessary (and unpleasant) > surprises regarding the behavior of his/her program.
I agree totally.
> I am not "a REBOL programmer". I am a programmer who uses > many languages, of which REBOL is one. Understanding how the > parts of our language fit (and work) together, and doing so in > terms of standard computing concepts and terminology, helps > with the choice of which lanaguage(s) is/are appropriate for > a given task, and helps translate an algorithm expressed in > one language into another.
Agree again.
> I have several friends who teach in higher education. I am on > the advisory committees for two computer engineering curricula. > I would love to be able to recommend REBOL as suitable for > teaching (and perhaps even research in) computer programming, > but cannot yet do so. One of the reasons is the current absence > of a complete model for REBOL semantics. Whenever one has a > language where the most effective response to a question is > "I don't know; let's try it and find out." one has a language > that is not ready for prime time, at least educationally.
I'd say perhaps educationally, just not anywhere else. (;
> Those are a few (though not all) of my motivations for being > interested. Anyone not interested in any of the above issues > is certainly free to ignore the whole discussion. ;-)
Won't be doing that - it's an important one. Though I have to admit that trial and error is sometimes a quicker way to find out how something in REBOL works than looking through the books or on the website for the information, even when it's there. No index with the User Guide was not a good idea. I only hope the View guide has one...
> -jn- > ------------------------------------------------------------ > "Programming languages: compact, powerful, simple ... > Pick any two!" joel'dot'neely'at'fedex'dot'com > ------------------------------------------------------------
-- Carl Read [carl--cybercraft--co--nz]