• 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: OO Theory misconceptions (was Re: can I make a list of
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: OO Theory misconceptions (was Re: can I make a list of


  • Subject: Re: OO Theory misconceptions (was Re: can I make a list of
  • From: email@hidden (Michael Sullivan)
  • Date: Thu, 31 Jan 2002 18:10:40 -0500
  • Organization: Society for the Incurably Pompous

> On 1/31/02 1:24 AM, Emmanuel <email@hidden> wrote:
>
> >I don't know if this is polymorphism or what, but what I regret much with
> >AS is that you cannot make the usual operators work with different data
> >types, like in the example "2 & 3" given earlier in this thread.

> What would you want "2 & 3" to return? Currently, it returns {2, 3}.

> >From our point of view (the scientifics', in short), it would be cool, say,
> >if an osax could give a sense to x+y where x and y are lists.

> What would you want that to return? My guess is that {1, 2} + {3, 4}
> should return either {5, 9} or {5, 8, 6, 9}

Doesn't matter. I'm guessing Emmanuel knows how to write the script to
have it return whatever he wants. What he's looking for is operator
overloading so he can write a handler where the calls look like:

set z to x + y

instead of

set z to ADTAdditionHandlerName(x,y)

or

set z to ADTAdditionHandlerName of x beside y

or

set z to ADTAdditionHandlerName given leftOperand:x, rightOperand:y


AFAIK, Applescript doesn't support any sort of operator overloading. I
suppose I should read through the ASLG again before I make that claim,
or I'll have Scott on my case again :).


Michael

--
Michael Sullivan
Business Card Express of CT Thermographers to the Trade
Cheshire, CT email@hidden


  • Prev by Date: Re: Export to a PDF from Quark
  • Next by Date: How to coerce a real to an integer in X?
  • Previous by thread: Re: OO Theory misconceptions (was Re: can I make a list of
  • Next by thread: Re: OO Theory misconceptions (was Re: can I make a list of
  • Index(es):
    • Date
    • Thread