• 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: Coercion of string to a record label
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Coercion of string to a record label


  • Subject: Re: Coercion of string to a record label
  • From: Harald E Brandt <email@hidden>
  • Date: Tue, 9 Oct 2001 22:57:44 +0200

+--> Olof Hellman wrote 01-10-09:
>Ah, my favorite topic. From a suggestion of mine, cleaned up by Emmanuel:
>
>to usrf(theList)
> script
> {+class usrf;:theList}
> end script
> run script the result
>end usrf
>
>usrf({"a", 1, "b", 2})
>
>--> {a:1, b:2}
+-

So I can make a record of a list.
But the task was to get the property value from a record, based on a property label given as a string. I don't really see how that can easily be done using the above method - although I might be blind.

I *do*, however, see how the above can be used to set a single property, although I really think it is inelegant (since it is a concatenation):

set myRecord to {EU:"123", US:"789"}
set aRegion to "eu" --got to be lower case
set myRecord to usrf({aRegion, "99"}) & myRecord
-->{EU:"99", US:"789"}

______heb________________________________________________________________
Harald E Brandt email@hidden PGP/MIME aware http://heb.bragit.com


  • Follow-Ups:
    • Re: Coercion of string to a record label
      • From: Bryan <email@hidden>
References: 
 >Coercion of string to a record label (From: Olof Hellman <email@hidden>)

  • Prev by Date: Re: Facespan and Printing Postscript in Quark
  • Next by Date: Re: Coercion of string to a record property label
  • Previous by thread: Coercion of string to a record label
  • Next by thread: Re: Coercion of string to a record label
  • Index(es):
    • Date
    • Thread