Re: References, equals, and repeats (Was: Coerce string to strin
Re: References, equals, and repeats (Was: Coerce string to strin
- Subject: Re: References, equals, and repeats (Was: Coerce string to strin
- From: Bill Cheeseman <email@hidden>
- Date: Fri, 15 Feb 2002 04:31:22 -0500
on 02-02-14 11:17 PM, Chris Page at email@hidden wrote:
>
On Thursday, February 14, 2002, at 07:36 , email@hidden wrote:
>
>
> Most languages seem to have this same strict definition of
>
> equality. For
>
> example, Java and Javascript both consider two reference types to
>
> be equal only
>
> if they refer to the same object. C certainly doesn't think &x ==
>
> x (except
>
> coincidentally). Visual Basic only allows "=" for numbers and
>
> strings, but
>
> provides "Is" as a "refers to the same object" strict equality
>
> operator.
>
>
That's why some languages, such as Dylan and Lisp, have separate
>
operators for "equivalent values" vs. "are the same object". In
>
Dylan's case, the operators are "=" and "==". In fact, I believe
>
Lisp has one or two other kinds of "equals" beyond this.
Cocoa on Mac OS X has isEqual: for object identity (same memory address) and
isEqualToString: and similar for contents equality. These are part of the
Cocoa frameworks, of course, not an inherent part of Objective-C.
--
Bill Cheeseman - email@hidden
Quechee Software, Quechee, Vermont, USA
http://www.quecheesoftware.com
The AppleScript Sourcebook -
http://www.AppleScriptSourcebook.com
Vermont Recipes -
http://www.stepwise.com/Articles/VermontRecipes
Croquet Club of Vermont -
http://members.valley.net/croquetvermont
_______________________________________________
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.