• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Just submitted this to BugReporter as feature request - comments...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Just submitted this to BugReporter as feature request - comments...


  • Subject: Re: Just submitted this to BugReporter as feature request - comments...
  • From: Nigel Garvey <email@hidden>
  • Date: Sun, 11 Apr 2004 16:17:24 +0100

Jim Witte wrote on Sat, 10 Apr 2004 15:03:26 -0500:

> As for the 'put' command - I have never liked AS's 'set' command - it
>makes sense to *set* properties such as the height of an object. It
>does not however make as much sense to "set" a variable. It makes
>sense, but it's not what people generally say when they are referring
>to real world containers, which after all, are what variables are -
>containers. One never says "I set water into the bucket". HC
>succeeded because the programming language metaphors matched the
>real-world metaphors they were trying to emulate. AS doesn't do this
>as much (and I have written quite a lot of HC in my time, and a fair
>amount of AS too)

It sounds as though you want to change the language to suit your own
metaphor here. You think of variables as containers into which you put
values. Others think of variables more realistically as pointers to
values stored somewhere else in memory. 'Set' is a perfectly good word in
this case. It accurately reflects the fact that you're doing something
with the variable and not with the value.

> The 'copy' command is closer to the English language usage, but
>again, not quote. To copy implies that the destination already exists,
>and that the source will continue to exist after the execution. This
>is true with variables, but it is also (assummed) true with 'put' and
>'set' as well (that's where the metaphorical relation between
>computer-variables and real-world-objects breaks - the contents of
>variables are almost ALWAYS copied, whereas real-world objects cannot
>be generally)

When you get to this level of rationalisation, it's better to ditch the
metaphors rather than the "real world", otherwise you can confuse
yourself and everyone else. The word "put" doesn't reflect what actually
happens when you set a variable. It's also particularly unfortunate in
its AppleScript rtle as an alternative term for 'copy'. That's probably
the main reason why hardly anyone uses it. The similarly rare 'returning'
is also useless as a metaphor for 'set'.

'set' - set a pointer that the compiler knows how to find to enable the
later retrieval of a value that either exists already or comes into
existence as a result of the rest of the line.
'copy' - duplicate a value that either exists already or comes into
existence as a result of the rest of the line and set a pointer that the
compiler knows how to find to enable the later retrieval of the duplicate.

The statement "the contents of variables are almost ALWAYS copied" is
thus both metaphorically misleading and factually wrong.

NG
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.


  • Prev by Date: Re: has option in system attributes
  • Next by Date: Re: (2 of 2) Application Scripting Question - Theoretical? (was Re: Technote 2106 is da Bomb)
  • Previous by thread: Re: Just submitted this to BugReporter as feature request - comments...
  • Next by thread: problem with a mail.app script
  • Index(es):
    • Date
    • Thread