Re: Introducing "Array Of" RFC

From: Date: Mon, 20 Jan 2014 22:32:41 +0000
Subject: Re: Introducing "Array Of" RFC
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17  Groups: php.internals 
Request: Send a blank email to internals+get-71366@lists.php.net to get a copy of this message
Stas Malyshev wrote:
But at least it feels for me more "natural" - you just generate a bunch of code (there are a number of cans on worms in it but I ignore it for now). Checking each element post-factum just feels wrong way to approach it.
I write the code for the spanner ... which will only ever create a spanner ... then I call it N times to create the bag of spanners perhaps with a parameter for the size of the spanner. Why do I need something to stop me adding an adjustable wrench to the bag? I just don't call any other code when adding to that bag? But I can also add sockets to the bag if I want different types of nut tools ... There is no 'extra' code, we need the code to creat the basic object anyway? I may want to create a bag with a fixed number of spaces for spanners, so I create a bag of N 'NULL' spaces which I can then upgrade to a spanner object later. These 'NULL' objects are simply sizes of spanner that we don't currently have yet. A more practical example of this would be with my genealogical data where we have spaces for ancestors - parents/grandparents - but these objects have not yet been identified. They are still 'person' objects but we don't need to create an empty person object, just an empty element in the array? We only create a real object when we have the data to create it. -- Lester Caine - G8HFL ----------------------------- Contact - http://lsces.co.uk/wiki/?page=contact L.S.Caine Electronic Services - http://lsces.co.uk EnquirySolve - http://enquirysolve.com/ Model Engineers Digital Workshop - http://medw.co.uk Rainbow Digital Media - http://rainbowdigitalmedia.co.uk

« previous php.internals (#71366) next »