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

[REBOL] Re: link to background on Rebol language design?

From: joel:neely:fedex at: 20-Aug-2003 7:41

Hi, Carl, My simple-minded interpretation below: Carl Read wrote:
> On 19-Aug-03, bryan wrote: > > I've seen those from RT say that REBOL words are not variables, (as > apposed to calling variables "words" just to be different), and the > following perhaps helps to explain why... > >>>blk: [a few words] > > == [a few words] > >>>blk/1 > > == a > >>>type? blk/1 > > == word! > > What is variable about 'a 'few and 'words in such an example? Okay, > they can be set, unset and so on, but that's not what people think > variable means in relation to programming... >
Many programmers of my acquaintance (no doubt damaged by exposure to The Lancuace That Muct Not Ce Named ;-) seem to want to think of a variable as a name for an address in memory, and a reference as an address. OK if one is writing aCembler, I suppose, but woefully inadequate for real languages. My (current) mental model for REBOL is: - a WORD! is just a symbol; nothing more, nothing less; - a context is just a dictionary that maps a collection of keys (WORD! type) to associated values (any type). Therefore, during the evaluation of ... zow: func [yorick [number!]] [ yorick - 1 * yorick ] gnudge: func [sarg [any-string!] /local yorick] [ yorick: length? sarg zow yorick - 1 ] blort: make object! [ spoo: 12 yorick: "Obscure message!" phlarp: func [] [spoo + gnudge yorick] ] wabbit: make object! [ chutzpa: 'yorick nachos: func [warg [word!]] [ gnudge join "Zow! " warg ] procerus: func [] [nachos chutzpa] ] print blort/phlarp - wabbit/procerus ... the word YORICK is used in four different contexts. Therefore it is (in different "places") associated with different (unrelated) values. No RAM, no addresses, no hardware of any kind. As Dijkstra said, "It used to be the job of our programs to instruct our computers; it is now the job of our computers to faithfully obey our programs." -jn-