• 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: can I make a list of records?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: can I make a list of records?


  • Subject: Re: can I make a list of records?
  • From: "Serge Belleudy-d'Espinose" <email@hidden>
  • Date: Tue, 29 Jan 2002 17:53:51 +0100

At 16:25 +0000 29/01/02, Nigel Garvey wrote:

> >set MyList to {}
> >set myFirstRecord to {a:1, b:2}
> >set mySecondRecord to {a:3, b:4}
> >set MyList to MyList & myFirstRecord & mySecondRecord
> >
> >--> {a:1, b:2}
>
>This is really odd. Could it be that MyList is starting life as an empty
>record rather than an empty list?

set myVar to {} as list
set myVar to myVar & {myRec:"rec"}
class of myVar
-- record

set myVar to {1} as list
set myVar to myVar & {myRec:"rec"}
class of myVar
-- list

So: empty list gets coerced to record, non-empty list gets record coerced to list. Seems there is at least an exception to the rule of coercing from right to left...


Serge
--
\\//\//\// Serge Belleudy-d'Espinose Institut Jacques Monod - Jussieu
// // // http://www.ijm.jussieu.fr/ Universites Paris VI, VII - CNRS
//\//\//\\


References: 
 >Re: can I make a list of records? (From: Nigel Garvey <email@hidden>)

  • Prev by Date: Re: can I make a list of records?
  • Next by Date: Re: Scripting Additions: Embracing the Horror of Unix
  • Previous by thread: Re: can I make a list of records?
  • Next by thread: Re: can I make a list of records?
  • Index(es):
    • Date
    • Thread