|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Am 23.09.2018 um 20:56 schrieb Kenneth:
> Great feature.
>
> With which version number (or alpha/beta) did 'mixed' become usable? I must have
> missed the earlier announcement(s).
Mixed-type arrays were /supposed/ to work ever since v3.7.1-beta.1
(without requiring the `mixed` keyword), but strangely enough nobody
seems to have actually tried it out.
It /does/ work (requiring `mixed`) since v3.8.0-alpha.9850723. (Which,
as you may notice, hasn't even been announced yet at the time I'm
writing this.)
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On 9/23/18 1:53 PM, clipka wrote:
> Contrary to earlier claims, intentions, the documentation already on the
> Wiki, and my own clouded memory, the restriction that array elements
> have to be of the same type has /not/ been removed.
>
> While I could fix this, I have decided not to, as same-type arrays are
> clearly the default use case, and it may actually be helpful to get an
> early error message when accidently assigning a value of a mismatching
> type to one element.
>
> Instead, the behaviour will be changed as follows:
>
>
> In an array declaration, the `array` keyword may be followed by the
> `mixed` keyword. This declares the array as a /mixed-type array/,
> allowing it to hold elements of different types.
>
> Example:
>
> #declare Foo = array mixed[3];
> #declare Foo[0] = 42;
> #declare Foo[1] = "Fnord";
> #declare Foo[2] = sphere { <0,0,0>, 1 }
>
done: http://wiki.povray.org/content/Reference:Array
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Am 04.10.2018 um 13:09 schrieb Jim Holsenback:
> done: http://wiki.povray.org/content/Reference:Array
Thanks.
As usual, I keep finding nits to pick.
New nits:
- The syntax isn't clean with respect to which square brackets (`[`,
`]`) are literal characters and which indicate optional items. Most
notably, `[ mixed ]` (an optional keyword) is currently written in just
the same style as `[ INT ]` (an integer surrounded by brackets).
To the best of my understanding, the convention is that an opening
square bracket followed by a blank or a closing square bracket preceded
by a blank is meant to indicate a literal square bracket, while an
opening (closing) square bracket followed (preceded) by anything else is
meant to indicate an optional item.
Thus, it should be `array[mixed][ INT ][[ INT ]]..` (or, maybe even
clearer yet, `array [mixed] [ INT ] [[ INT ]]..`).
- The sentence "Any attempt to reference an uninitialized element
results in an error." may be misunderstood to apply only when the
`mixed` keyword is used.
Old nits:
- The syntax of `DICTIONARY_ITEM` is broken w/r/t the first variant:
Besides the aforementioned bracket issue (here being just the other way
round), the syntax implies that the string must be a literal, while in
fact it can be an arbitrary string expression. So it should be something
along the lines of `[ STRING ] :` or `[ STRING_EXPRESSION ] :`.
- The syntax of ARRAY_DECLARATION does not yet reflect that the
dimensions may be omitted altogether (creating a 1-dimensional
dynamically-sized array), so it should actually be `array [mixed] [[ INT
]]..`.
While I'm at it, maybe we should overhaul the way we present the syntax
altogether; I've written up a few ideas in
http://wiki.povray.org/content/User:Clipka/Syntax, some of which should
be reasonably easy to write.
(Of course if we go that route, I wouldn't expect you to do the boring
part of the work, just to set up the necessary framework.)
BTW, is there no easy shortcut to writing `<code>` tags? It's being used
a lot in our docs and is tedious to write. In Markdown, one would simply
use backticks (`) around the code, for instance.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Am 05.10.2018 um 19:32 schrieb clipka:
> As usual, I keep finding nits to pick.
I was a bit too quick with my previous post; there's more:
New nit:
- The bullet list "New to version 3.8 points to also consider" still
simply claims that "Array alements no longer have to be all of the same
type"; I'd simply replace that entire bullet item with "Arrays declared
as `mixed` have a larger memory footprint, even if all elements are
actually of the same type." or something along that line.
Old nit:
- A lot of the bullets refer to dynamically-sized arrays; maybe it is
worth "bundling" them together as is done for the dictionary-related
bullet points.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On 10/05/2018 01:32 PM, clipka wrote:
>
> Thus, it should be `array[mixed][ INT ][[ INT ]]..` (or, maybe even
> clearer yet, `array [mixed] [ INT ] [[ INT ]]..`).
>
Definitely need the space after array. The top one I read as the token
is either 'array' or 'arraymixed' .
--
dik
Rendered 1024 of 921600 pixels (0%)
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On 10/5/18 1:32 PM, clipka wrote:
> Am 04.10.2018 um 13:09 schrieb Jim Holsenback:
>
>> done: http://wiki.povray.org/content/Reference:Array
>
> Thanks.
>
> As usual, I keep finding nits to pick.
lord have mercy on me ... you've just got too much time on your hands.
/somebody/ please give me a amen on this! i'm finding most of what you
write is just so tedious ... takes me reading it 3 or 4 times before it
finally sinks in. i see more value in proceeding with the release and
tabling this /overhaul/ until a later date
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On 06/10/2018 10:23, Jim Holsenback wrote:
> On 10/5/18 1:32 PM, clipka wrote:
>> Am 04.10.2018 um 13:09 schrieb Jim Holsenback:
>>
>>> done: http://wiki.povray.org/content/Reference:Array
>>
>> Thanks.
>>
>> As usual, I keep finding nits to pick.
>
> lord have mercy on me ... you've just got too much time on your hands.
> /somebody/ please give me a amen on this!
https://www.youtube.com/watch?v=GAhbLcSpdlw
;)
--
Regards
Stephen
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On 10/6/18 6:19 AM, Stephen wrote:
> On 06/10/2018 10:23, Jim Holsenback wrote:
>> On 10/5/18 1:32 PM, clipka wrote:
>>> Am 04.10.2018 um 13:09 schrieb Jim Holsenback:
>>>
>>>> done: http://wiki.povray.org/content/Reference:Array
>>>
>>> Thanks.
>>>
>>> As usual, I keep finding nits to pick.
>>
>> lord have mercy on me ... you've just got too much time on your hands.
>> /somebody/ please give me a amen on this!
>
>
> https://www.youtube.com/watch?v=GAhbLcSpdlw
>
> ;)
>
>
i was going to say holy crap (ok pun intended) instead ... i'm wondering
what/if you'd have posted if i did. style points for what you /did/ post
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On 06/10/2018 14:29, Jim Holsenback wrote:
>>
> i was going to say holy crap (ok pun intended) instead ... i'm wondering
> what/if you'd have posted if i did.
Isn't that what Manna is, Holy Crap? :)
According to Jack L. Chalker it was what Tinker bell's fairy dust was.
(Maybe not so holy.)
> style points for what you /did/ post
:D
I do like a good Amen and that one makes a change from Handel's Messiah.
--
Regards
Stephen
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Am 06.10.2018 um 11:23 schrieb Jim Holsenback:
> On 10/5/18 1:32 PM, clipka wrote:
>> Am 04.10.2018 um 13:09 schrieb Jim Holsenback:
>>
>>> done: http://wiki.povray.org/content/Reference:Array
>>
>> Thanks.
>>
>> As usual, I keep finding nits to pick.
>
> lord have mercy on me ... you've just got too much time on your hands.
Indeed, currently I do.
> /somebody/ please give me a amen on this! i'm finding most of what you
> write is just so tedious ... takes me reading it 3 or 4 times before it
> finally sinks in.
Sorry about that; I've never claimed to be a good documentation writer.
> i see more value in proceeding with the release and
> tabling this /overhaul/ until a later date
I presume you're talking about the syntax overhaul there - yes, I'm
perfectly fine with shelving the idea for now. It's mainly just a
thought that I had to follow a couple of steps and then get out of my
system. It needs some ripening anyway.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |