POV-Ray : Newsgroups : povray.beta-test : none keyword Server Time
29 Mar 2024 01:22:43 EDT (-0400)
  none keyword (Message 1 to 5 of 5)  
From: ingo
Subject: none keyword
Date: 5 Jan 2019 04:53:49
Message: <XnsA9CE6ED9DE6D1seed7@news.povray.org>
A feature request,

#declare Arr = array[10]{};
#declare Arr[3]= 5;
this results in a partially 'filled' array that can't be written to a 
file and then #included.
Something like #declare Arr = array[10]{,,,5,,,,..} won't work.

True, false & co. are values, so I can't put those as fillers in an array 
with values as they will be seen as legit values. They can't be used in 
an array with strings or objects (unless the array is of mixed type).

In an array with strings one could use an empty string "", in an array 
with values an odd one, -9999.99, same with vectors.
You can't use an empty object{} anywhere.

Could a 'none' keyword be introduced as a general placeholder for 
emptyness? 
object{none}
#declare Arr = array[10]{none,none,none,5,...}
#if(... none)
#while(... none)
#ifndef(Arr[I])#write(File,none)#end
#macro DoThing(A, optional B, optional C)
DoThing("Great thing", none, true)

ingo


Post a reply to this message

From: clipka
Subject: Re: none keyword
Date: 5 Jan 2019 06:47:41
Message: <5c30995d$1@news.povray.org>
Am 05.01.2019 um 10:53 schrieb ingo:

> Could a 'none' keyword be introduced as a general placeholder for
> emptyness?
> object{none}
> #declare Arr = array[10]{none,none,none,5,...}
> #if(... none)
> #while(... none)
> #ifndef(Arr[I])#write(File,none)#end
> #macro DoThing(A, optional B, optional C)
> DoThing("Great thing", none, true)

Should be possible, though I'd probably favour `undef` for that purpose: 
It avoids introducing another keyword, and also makes it perfectly clear 
what happens to that array entry.


Post a reply to this message

From: ingo
Subject: Re: none keyword
Date: 5 Jan 2019 07:27:02
Message: <XnsA9CE88D406FA3seed7@news.povray.org>
in news:5c30995d$1@news.povray.org clipka wrote:

> I'd probably favour `undef`

Yep, that's even more explicit.

ingo


Post a reply to this message

From: Mike Horvath
Subject: Re: none keyword
Date: 3 Mar 2019 19:03:56
Message: <5c7c6b6c$1@news.povray.org>
Some other options are "null" or "nil".

Mike



On 1/5/2019 4:53 AM, ingo wrote:
> A feature request,
> 
> #declare Arr = array[10]{};
> #declare Arr[3]= 5;
> this results in a partially 'filled' array that can't be written to a
> file and then #included.
> Something like #declare Arr = array[10]{,,,5,,,,..} won't work.
> 
> True, false & co. are values, so I can't put those as fillers in an array
> with values as they will be seen as legit values. They can't be used in
> an array with strings or objects (unless the array is of mixed type).
> 
> In an array with strings one could use an empty string "", in an array
> with values an odd one, -9999.99, same with vectors.
> You can't use an empty object{} anywhere.
> 
> Could a 'none' keyword be introduced as a general placeholder for
> emptyness?
> object{none}
> #declare Arr = array[10]{none,none,none,5,...}
> #if(... none)
> #while(... none)
> #ifndef(Arr[I])#write(File,none)#end
> #macro DoThing(A, optional B, optional C)
> DoThing("Great thing", none, true)
> 
> ingo
>


Post a reply to this message

From: clipka
Subject: Re: none keyword
Date: 7 Mar 2019 10:29:55
Message: <5c8138f3@news.povray.org>
Am 04.03.2019 um 01:03 schrieb Mike Horvath:
> Some other options are "null" or "nil".

"null" is misleading because it can be misinterpreted as "zero". As a 
matter of fact, that's exactly what `NULL` is in C, where everyone and 
their uncle borrowed the name from; it just happens to be used a lot in 
pointers, because in C pointers and integer values are highly 
interchangeable.

"nil" is stupid because it is a technical acronym that's not applicable 
in many contexts: "Not In List".


"void" also comes to mind.

"mu" from Zen philosophy might also do nicely, if it wasn't prone to be 
mistaken for a greek letter of same name.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.