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

[REBOL] Fwd: Re: Re: On mutability and sameness

From: robbo1mark:aol at: 19-Jun-2001 12:36

-- Attached file included as plaintext by Listar -- Return-Path: <[Robbo1Mark--aol--com]> Received: from web28.aolmail.aol.com (web28.aolmail.aol.com [205.188.222.4]) by air-id07.mx.aol.com (v79.20) with ESMTP id MAILINID76-0619114752; Tue, 19 Jun 2001 11:47:52 -0400 Date: Tue, 19 Jun 2001 11:47:50 EDT From: [Robbo1Mark--aol--com] Subject:Re: [REBOL] Re: On mutability and sameness To: <[Robbo1Mark--aol--com]> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Mailer: Unknown (No Version) Message-ID: <[a6--1588ac85--2860ce28--aol--com]> Earlier I wrote.... Similarly....
>> a: <abc>
== <abc>
>> parse a [b:]
== false
>> b
== "123" As Homer Simpson would famously say "D'oh!!!!!!" it should read....
>> b
== "abc" fingers working faster than the brain here... sorry! Anyway the point is you can use this to prove that B can be set as a string! copy of A regardless of whether you set A as a tag! , url! , issue! , file! or whatever any-string! type value you fancy. A & B remain as references to the SAME string! data in the same memory location, that is why changes to either effect both. Sorry for the typo earlier. 8-) Still busily painting my fence here 8-) Fancy helping me paint at the weekend Jeff? but please don't bring only whitewash! Only joking! honest! Mark In a message dated Tue, 19 Jun 2001 11:34:12 AM Eastern Daylight Time, Robbo1Mark writes: << JEFF, I essence you are correct, but how easier can you more properly explain these examples.....
>> a: "123"
== "123"
>> b: a
== "123"
>> c: "123"
== "123" 'a & 'b are the "SAME" string! and refer to the same memory location. 'c has the same value on the surface but is a separate instance of a string! value and is stored at a separate memory location. That is why this....
>> insert b "abc"
== "123"
>> b
== "abc123"
>> a
== "abc123"
>> c
== "123" The value of 'A & 'B both change but 'C remains unaltered. You can show this in 'C ( or some other language ) by use of pointers and references as Joel did. Similarly....
>> a: <abc>
== <abc>
>> parse a [b:]
== false
>> b
== "123" How do you explain that unless you drop down to C or something else and show your any-string! or any-block! models with pointers to memory storage for the actual "data" values. In the above example both reference the "Same" string! data but 'a has the datatype! value tag! whilst 'b is a normal string! datatype! Sometimes to understand what's in a forest and what makes a forest you've got to look at trees and leaves and leaf / tree cells. Afterall thats how you really UNDERSTAND trees & forests, even if it is from the bottom up. Also what is wrong with helping your neighbour to paint his fence is you neighbour is your friend? Depends who has more REBOL spirit, Huckleberry Finn or Aunt Polly? cheers Jeff 8-) Mark Dickson In a message dated Tue, 19 Jun 2001 11:01:20 AM Eastern Daylight Time, Jeff Kreis <[jeff--rebol--net]> writes: << [Robbo1Mark--aol--com]:
>> .... Having followed this thread with interest, I believe,
barring the disclaimer above, that both Joel & Ladislav are WRONG in the sense that some REBOL behaviour can only be explained and understood fully in terms of the way it has been implemented.<< That's a very bottom up way to think of things. When we implement parts of REBOL we first sit down and say "how is this supposed to work-- what are the rules it obeys." Once we understand what something is supposed to do, then we write the lower level code that does that thing we've figured out. It's a process of describing in a low level, something you understand at a high level. You're claiming to want to understand something at a high level by considering how it is expressed at a low level. That's like trying to understand what an Elephant IS by looking at one of its cells under a microscope. How do you even know what you're looking at is an Elephant? The way functionality is implemented is arbitrary as long as it is reasonably space and cpu efficient and the implementation behaves according to the high level functionality that's desired. Joel's got this one on the head. You gain little understanding of something like series by trying to build series in C. You'll miss the forest for the trees, so to speak. Robbo:
>>To fully understand the behviour of any-block! or
any-string! series! values you have to have a model of how series! values are implemented at the C code level from which REBOL is built. ... Whilst any C code model we might build for REBOL values... will most probably NOT exactly match the RT official implementation, I think it is important conceptually that we do TRY to conceptually build an implementation model.<< Joel:
>> C may be OK for giving examples, but it is certainly not
the only way to think about computing, IMHO.<< Yes, but I think Mark's interest in having things "explained" in terms of C code has less to do with "understanding REBOL" at a high level, and more to do with having people help "paint his fence", if you've ever read Tom Sawyer. ;-) -jeff