POV-Ray : Newsgroups : povray.general : How about $ for declare? Server Time
13 Oct 2026 09:51:45 EDT (-0400)
  How about $ for declare? (Message 1 to 37 of 37)  
From: Stefan Viljoen
Subject: How about $ for declare?
Date: 13 Aug 2004 15:42:40
Message: <411d19af@news.povray.org>
Hi guys

Megapov 0.7 (I heard) had $ instead of #declare...

What is the reason why this wasn't implemented in official Pov 3.1 or 3.5?

Seems like a very nice feature to just go $variablename instead of #declare
all over in a .pov file. Quicker to type, easier to read, and so on.

Any team guys? Christoph?
-- 
Stefan Viljoen
Software Support Technician
Polar Design Solutions


Post a reply to this message

From: Christoph Hormann
Subject: Re: How about $ for declare?
Date: 13 Aug 2004 17:35:01
Message: <cfjc1l$vh2$1@chho.imagico.de>
Stefan Viljoen <rylan@ wrote:
> Hi guys
> 
> Megapov 0.7 (I heard) had $ instead of #declare...
> 
> What is the reason why this wasn't implemented in official Pov 3.1 or 3.5?
> 

It leads to awfully obfuscated code.  When designing a new language the 
idea to leave away the #declare (or whatever else) completely is 
reasonable.  But if it is required replacing it with a single character 
is not a good idea.  With the same arguments you could replace every 
other keyword with the shortest unique abbreviation - but no one could 
read the code any more then.

Christoph

-- 
POV-Ray tutorials, include files, Sim-POV,
HCR-Edit and more: http://www.tu-bs.de/~y0013390/
Last updated 06 Jul. 2004 _____./\/^>_*_<^\/\.______


Post a reply to this message

From: Rafal 'Raf256' Maj
Subject: Re: How about $ for declare?
Date: 13 Aug 2004 18:17:32
Message: <Xns954536876C74raf256com@203.29.75.35>
chr### [at] gmxde news:cfjc1l$vh2$1@chho.imagico.de

> other keyword with the shortest unique abbreviation - but no one could 
> read the code any more then.

Btw, how about adding some shorten forms for long and often used keywords, 
it could spedd up typing and comforable level of hand-typing .pov code, 
like

light { y*10 rgb 1 }
diff {
  box { -5, +5 }
  sphere { 0 10 }
  text { 
  pig { bozo cmap{0:<1,0,0> .5:<1,1,0> 1:1} } 
  norm{ bozo .5 }  
  fin { refl .5 phong 0.5,70 spec 0.1,0.06 }
}

?

Aliasing keyword is probably easy, another format of for example color_map 
perhaps not so much.

Just an idea.

-- 
http://www.raf256.com/3d/
Rafal Maj 'Raf256', home page - http://www.raf256.com/me/
Computer Graphics


Post a reply to this message

From: Samuel Benge
Subject: Re: How about $ for declare?
Date: 13 Aug 2004 18:57:36
Message: <411D46BF.4050809@hotmail.com>
Rafal 'Raf256' Maj wrote:

> chr### [at] gmxde news:cfjc1l$vh2$1@chho.imagico.de
> 
> 
>>other keyword with the shortest unique abbreviation - but no one could 
>>read the code any more then.
>>
> 
> Btw, how about adding some shorten forms for long and often used keywords, 
> it could spedd up typing and comforable level of hand-typing .pov code, 
> like

Better yet, why not have the ability to make new #aliases for keywords. 
Something like this:

#alias sphere=sph;

sph{ <0,0,0>, 10 pigment{White} }

-Sam


Post a reply to this message

From: Alain
Subject: Re: How about $ for declare?
Date: 13 Aug 2004 19:07:44
Message: <411d49c0$1@news.povray.org>
Rafal 'Raf256' Maj nous apporta ses lumieres ainsi en ce 13/08/2004 
18:17... :

>chr### [at] gmxde news:cfjc1l$vh2$1@chho.imagico.de
>
>  
>
>>other keyword with the shortest unique abbreviation - but no one could 
>>read the code any more then.
>>    
>>
>
>Btw, how about adding some shorten forms for long and often used keywords, 
>it could spedd up typing and comforable level of hand-typing .pov code, 
>like
>
>light { y*10 rgb 1 }
>diff {
>  box { -5, +5 }
>  sphere { 0 10 }
>  text { 
>  pig { bozo cmap{0:<1,0,0> .5:<1,1,0> 1:1} } 
>  norm{ bozo .5 }  
>  fin { refl .5 phong 0.5,70 spec 0.1,0.06 }
>}
>
>?
>
>Aliasing keyword is probably easy, another format of for example color_map 
>perhaps not so much.
>
>Just an idea.
>
>  
>
You can create a shorthand.inc include that define those abreviations as 
equivalant to whatever keyword you want. You even can translate every 
keyword to another language if you feel like it. If you then publish 
your scene, don't forget to also publish the include file(s).

Alain


Post a reply to this message

From: Rafal 'Raf256' Maj
Subject: Re: How about $ for declare?
Date: 13 Aug 2004 19:48:12
Message: <Xns954512C7765Araf256com@203.29.75.35>
aze### [at] qwertygov news:411d49c0$1@news.povray.org

> You can create a shorthand.inc include that define those abreviations as 
> equivalant to whatever keyword you want. You even can translate every 
> keyword to another language if you feel like it. If you then publish 
> your scene, don't forget to also publish the include file(s).
> 

Uhm? How exacly does it work? Sounds very interesting... something simmilar 
to what Samuel was talking about?

-- 
http://www.raf256.com/3d/
Rafal Maj 'Raf256', home page - http://www.raf256.com/me/
Computer Graphics


Post a reply to this message

From: Alain
Subject: Re: How about $ for declare?
Date: 13 Aug 2004 20:46:01
Message: <411d60c9$1@news.povray.org>
Rafal 'Raf256' Maj nous apporta ses lumieres ainsi en ce 13/08/2004 
19:48... :

>aze### [at] qwertygov news:411d49c0$1@news.povray.org
>
>  
>
>>You can create a shorthand.inc include that define those abreviations as 
>>equivalant to whatever keyword you want. You even can translate every 
>>keyword to another language if you feel like it. If you then publish 
>>your scene, don't forget to also publish the include file(s).
>>
>>    
>>
>
>Uhm? How exacly does it work? Sounds very interesting... something simmilar 
>to what Samuel was talking about?
>
>  
>
Something like:

#declare sph=sphere; //Abreviate sphere to sph
#declare boite=box; //Translate box to boite (french)

Alain


Post a reply to this message

From: Nicolas Alvarez
Subject: Re: How about $ for declare?
Date: 13 Aug 2004 23:33:31
Message: <411d880b@news.povray.org>
Cool idea!

--
- Nicolas Alvarez
nicoalvar0 [at] hotmail [dot] com

"Samuel Benge" <stb### [at] hotmailcom> escribió en el mensaje
news:411### [at] hotmailcom...
> Rafal 'Raf256' Maj wrote:
>
> > chr### [at] gmxde news:cfjc1l$vh2$1@chho.imagico.de
> >
> >
> >>other keyword with the shortest unique abbreviation - but no one could
> >>read the code any more then.
> >>
> >
> > Btw, how about adding some shorten forms for long and often used
keywords,
> > it could spedd up typing and comforable level of hand-typing .pov code,
> > like
>
> Better yet, why not have the ability to make new #aliases for keywords.
> Something like this:
>
> #alias sphere=sph;
>
> sph{ <0,0,0>, 10 pigment{White} }
>
> -Sam
>


Post a reply to this message

From: Nicolas Alvarez
Subject: Re: How about $ for declare?
Date: 13 Aug 2004 23:35:01
Message: <411d8865@news.povray.org>
The idea of using #alias is better so that you don't mix #declares with
abbreviations.

--
- Nicolas Alvarez
nicoalvar0 [at] hotmail [dot] com


"Alain" <aze### [at] qwertygov> escribió en el mensaje
news:411d60c9$1@news.povray.org...
> Rafal 'Raf256' Maj nous apporta ses lumieres ainsi en ce 13/08/2004
> 19:48... :
>
> >aze### [at] qwertygov news:411d49c0$1@news.povray.org
> >
> >
> >
> >>You can create a shorthand.inc include that define those abreviations
as
> >>equivalant to whatever keyword you want. You even can translate every
> >>keyword to another language if you feel like it. If you then publish
> >>your scene, don't forget to also publish the include file(s).
> >>
> >>
> >>
> >
> >Uhm? How exacly does it work? Sounds very interesting... something
simmilar
> >to what Samuel was talking about?
> >
> >
> >
> Something like:
>
> #declare sph=sphere; //Abreviate sphere to sph
> #declare boite=box; //Translate box to boite (french)
>
> Alain


Post a reply to this message

From: Samuel Benge
Subject: Re: How about $ for declare?
Date: 13 Aug 2004 23:42:25
Message: <411D8980.2020009@hotmail.com>
Alain wrote:

> Something like:
> 
> #declare sph=sphere; //Abreviate sphere to sph
> #declare boite=box; //Translate box to boite (french)
> 
> Alain

Well, that's good to know!

-Sam


Post a reply to this message

From: Slime
Subject: Re: How about $ for declare?
Date: 14 Aug 2004 02:03:28
Message: <411dab30@news.povray.org>
> #declare sph=sphere; //Abreviate sphere to sph
> #declare boite=box; //Translate box to boite (french)

Erm, this doesn't work. Were you saying it does or suggesting it as a
feature?

 - Slime
 [ http://www.slimeland.com/ ]


Post a reply to this message

From: Brian Elliott
Subject: Re: How about $ for declare?
Date: 14 Aug 2004 04:23:36
Message: <411dcc08@news.povray.org>
"Slime" <fak### [at] emailaddress> wrote in message
news:411dab30@news.povray.org...
> > #declare sph=sphere; //Abreviate sphere to sph
> > #declare boite=box; //Translate box to boite (french)
>
> Erm, this doesn't work. Were you saying it does or suggesting it as a
> feature?

You're quite right.  I tried it, and to alias it, you'd have to write:

  #macro sph() sphere #end

  sph() { <sphere and texture options> }

And the parentheses would have to be included with every invocation, adding
two more characters and obfuscation to otherwise straight code.  It would
hardly be a worthwhile "abbreviation"

Brian   :-)


Post a reply to this message

From: Rafal 'Raf256' Maj
Subject: Re: How about $ for declare?
Date: 14 Aug 2004 04:42:49
Message: <Xns95456D5662A7raf256com@203.29.75.35>
NotForSpam@AskIfUWant news:411dcc08@news.povray.org

> You're quite right.  I tried it, and to alias it, you'd have to write:
>   #macro sph() sphere #end
>   sph() { <sphere and texture options> }
> And the parentheses would have to be included with every invocation,
> adding two more characters and obfuscation to otherwise straight code.
>  It would hardly be a worthwhile "abbreviation"

so we just need an #macro that can be called without "()"... I think that

#alias sph sphere

is a good idea. Perhaps it is not hard to implement?


-- 
http://www.raf256.com/3d/
Rafal Maj 'Raf256', home page - http://www.raf256.com/me/
Computer Graphics


Post a reply to this message

From: Brian Elliott
Subject: Re: How about $ for declare?
Date: 14 Aug 2004 06:20:36
Message: <411de774@news.povray.org>
"Samuel Benge" <stb### [at] hotmailcom> wrote in message
news:411### [at] hotmailcom...
> Rafal 'Raf256' Maj wrote:
> >
> > Btw, how about adding some shorten forms for long and often used
keywords,
> > it could spedd up typing and comforable level of hand-typing .pov code,
> > like
>
> Better yet, why not have the ability to make new #aliases for keywords.
> Something like this:
>
> #alias sphere=sph;
>
> sph{ <0,0,0>, 10 pigment{White} }
>
> -Sam
>

Hello all,

Some cautionary words.

Aliasing sounds really beguiling, because being IT/Comp/Sci/Tech types,
we're all lazy when it comes to typing and repetition, and we tend to like
using the shortest sequence of keystrokes to create our code.   :-)

But on reflection (argh a RT pun), I believe it could unleash a bad genie on
the PoV-Ray community.  The genie's curse will be reduced legibility and
portability of the SDL.

Human nature being what it is, what'll happen is that the single PoV-Ray
language we have now will be replaced by a multitude of personal dialects,
as people make up whatever words they personally enjoy.  Instead of
"sphere", some will use "sph"; or "sp"; and there will be those who
particularly enjoy terse and dense code, who will condense it to a mere "s".
Authors from non-English origins might customise the SDL for their own
convenience, and use, eg., "esfera" instead!

This is perfectly fine if it is confined to one's own bedroom or study, but
there's an intensely active and diverse community around PoV-Ray and, let's
face it, this code will be shared on the Internet!

When reading someone else's aliased code, to ensure you understand their
typography, you must first seek and refer to their dictionary before you can
to understand the SDL body -eg. When this author writes "sp" on line 145 of
"myscene.pov" or "includefile3.inc", does it mean a "sphere" or a "spline"
or a locally-declared object type?

Also, consider portability:  Incorporating aliased segments of another
author's code into your work, which is either not aliased or uses different
conventions, will no longer be a simple drop-in operation -- it will be much
harder to port.

Imagine using code from three sources, created with three different
conventions.  What will you have to do to get it to work in your designs?
Especially if their "dictionary" is tucked away in a minor include file
somewhere, or it's spread across multiple files of hundreds of lines.  If
one of your sources aliased "sphere" with "sp" while another had aliased
"spline" with "sp", and you are trying to merge the two into a new scene or
into your whole code library, you have a real mess to sort out!!!

The end effect:  I think there are many people who would discard such code
rather then face the extra time and frustration of translating it.  Great
ideas could be discarded or not even looked at, because the author used
idiosyncratic language.  The free community exchange of ideas that happens
now would probably be reduced if aliasing were common, and I think that
would be a great pity if it happened.

Alternately, if you had aliased code and wanted to offer your creation into
the public community, you might have to convert it bact to standard syntax
first, nullifying any gains you originally got from it, either in time-saved
or visuals.

My sense of it is that the disadvantages eventually outweigh the advantages.

$0.02
Cheers,
  Brian


Post a reply to this message

From: Brian Elliott
Subject: Re: How about $ for declare?
Date: 14 Aug 2004 06:55:38
Message: <411defaa@news.povray.org>
"Rafal 'Raf256' Maj" <spa### [at] raf256com> wrote in message
news:Xns95456D5662A7raf256com@203.29.75.35...
> NotForSpam@AskIfUWant news:411dcc08@news.povray.org
>
> > You're quite right.  I tried it, and to alias it, you'd have to write:
> >   #macro sph() sphere #end
> >   sph() { <sphere and texture options> }
> > And the parentheses would have to be included with every invocation,
> > adding two more characters and obfuscation to otherwise straight code.
> >  It would hardly be a worthwhile "abbreviation"
>
> so we just need an #macro that can be called without "()"... I think that
>
> #alias sph sphere
>
> is a good idea. Perhaps it is not hard to implement?

Hi,

Whilst promoting the case for aliasing, please do consider *what and how
much*, really, is the material gain to be gotten by implementing it - eg.
typing "sph" instead of "sphere"?  Is "sphere" so inconvenient for an able
person to write, or such a major percentage of your entire SDL file?  Most
people I know who use computers a lot, and that includes programmers, are
usually very fast typists already.

I did a little experiment just now, and I succeded in typing "sphere " (with
trailing space) 19 times in 30 seconds, and that was WITH correcting several
mistakes.  But I spend a lot of "think time" when I am not actually typing
anything.  So aliasing will not save me much time!

Also, though this doesn't help those on open-source ports of PoV-Ray, the
Windows users of PoV-Ray have that lovely in-built editor.  All one need do
on WinPov is type "sph" then press Tab, and you have your complete word.
Try it with "pig" as well!

Meanwhile, I put some thoughts about aliasing in reply to Sam's message.
The implications are not immediately obvious behind the immediate personal
convenience, which is usually as far as people look when they decide on
something.  But potentially major consequential disadvantages do lie behind
aliasing, which I think should be considered carefully before the community
decides we really want this convenience feature.  If a solution is presented
that avoids the disadvantages, then good.

Cheers,
  Brian


Post a reply to this message

From: Severi Salminen
Subject: Re: How about $ for declare?
Date: 14 Aug 2004 07:03:17
Message: <411df175$1@news.povray.org>
> I did a little experiment just now, and I succeded in typing "sphere " (with
> trailing space) 19 times in 30 seconds, and that was WITH correcting several
> mistakes.  

I did 30 "sphere"s/30secs after a few practice runs. So, what is the 
POV-Ray community unofficial record? Only correctly typed words count.

I also think that there is little to gain by using aliasing. Also, how 
many people knows how to use TAB (at least in windows version) to use 
autocomplete feature? It also speeds up writing.

Severi


Post a reply to this message

From: Rafal 'Raf256' Maj
Subject: Re: How about $ for declare?
Date: 14 Aug 2004 07:29:31
Message: <Xns9545899845EFFraf256com@203.29.75.35>
NotForSpam@AskIfUWant news:411de774@news.povray.org



So I after all sugest _one_, oficial, additional short-alias set. 
It can be used in addition to normal keywords so both forms will be valid - 
short and full.

It will ne used only if it is needed for given keyword.


The aliases I sugest like:

1) alias
cylinder            cylind
superellipsoid      superel
isosurface          isosurf
light_source        light
area_light          areal
adaptive            adapt
reflection          refl
...

2) alias for several keywors used usually

oriented circular  bulll  // [light]bull light
oriented circular parallel  sunl // sun light

3) alias + another syntax, or only alias
specular x roughness y   spec x,y  
phong x,phong_size y   phong2 x,y   // "phong2" because "phong" is reserved
rotate A scale B translate C  position A,B,C  // this is most usual order 
                              // of transorms - rotate and scale, the 
                              // translate somewhere in scene

color_map {[0 rgb <1,0,0>][1 rgb <1,0,1>]} // replece this one with 
cmap{[0 <1,0,0>][1 <1,0,1>}                // this one
cmap{0:<1,0,0> 1:<1,0,1>}                  // ..or this one


4) perhaps this aliases (or maybe not)
pigment            pigm
finish             fin
normal             norm


sugestions?


-- 
http://www.raf256.com/3d/
Rafal Maj 'Raf256', home page - http://www.raf256.com/me/
Computer Graphics


Post a reply to this message

From: Rune
Subject: Re: How about $ for declare?
Date: 14 Aug 2004 10:24:39
Message: <411e20a7$1@news.povray.org>
Shorter words are not easier to read, only slightly faster to type. But you
can already save that typing in POV-Ray (for Windows anyway).

Try to type the following (where *TAB* means pressing TAB):

light*TAB**TAB*
dif*TAB*
pig*TAB*
norm*TAB*
fini*TAB*
spec*TAB*
refl*TAB*


Rune
-- 
3D images and anims, include files, tutorials and more:
rune|vision:  http://runevision.com
POV-Ray Ring: http://webring.povray.co.uk


Post a reply to this message

From: JWV
Subject: Re: How about $ for declare?
Date: 14 Aug 2004 10:59:50
Message: <411e28e6$1@news.povray.org>
> Try to type the following (where *TAB* means pressing TAB):
>
> light*TAB**TAB*
> dif*TAB*
> pig*TAB*
> norm*TAB*
> fini*TAB*
> spec*TAB*
> refl*TAB*

Thank you very much for this tip, I realy didn't know it!

> Seems like a very nice feature to just go $variablename instead of
#declare
> all over in a .pov file. Quicker to type, easier to read, and so on.

I agree with you, on both points (typing and reading). I suggest
implementing only this feature, besides giving the TAB-trick a more
prominent place in the FAQ/manual.

Greetings,

JWV

"Rune" <run### [at] runevisioncom> wrote in message
news:411e20a7$1@news.povray.org...
> Shorter words are not easier to read, only slightly faster to type. But
you
> can already save that typing in POV-Ray (for Windows anyway).
>
> Try to type the following (where *TAB* means pressing TAB):
>
> light*TAB**TAB*
> dif*TAB*
> pig*TAB*
> norm*TAB*
> fini*TAB*
> spec*TAB*
> refl*TAB*
>
>
> Rune
> -- 
> 3D images and anims, include files, tutorials and more:
> rune|vision:  http://runevision.com
> POV-Ray Ring: http://webring.povray.co.uk
>
>


Post a reply to this message

From: Rafal 'Raf256' Maj
Subject: Re: How about $ for declare?
Date: 14 Aug 2004 13:23:32
Message: <Xns9545C59C3F23Braf256com@203.29.75.35>
run### [at] runevisioncom news:411e20a7$1@news.povray.org

> Try to type the following (where *TAB* means pressing TAB):
> light*TAB**TAB*

Oh, I thought that You where talking about this ctlr+space thingy, this 
definetely should be in FAQ, help and Tip of the day.

But I still suggest shortucts for most long expressions, for example 
reflection -> refl 
specular .5 roughness 0.01  -> spec .5, 0.01

etc... why not?

-- 
http://www.raf256.com/3d/
Rafal Maj 'Raf256', home page - http://www.raf256.com/me/
Computer Graphics


Post a reply to this message

From: Samuel Benge
Subject: Re: How about $ for declare?
Date: 14 Aug 2004 13:23:38
Message: <411E28B8.7080203@hotmail.com>
Brian Elliott wrote:
<snip>

> Also, though this doesn't help those on open-source ports of PoV-Ray, the
> Windows users of PoV-Ray have that lovely in-built editor.  All one need do
> on WinPov is type "sph" then press Tab, and you have your complete word.
> Try it with "pig" as well!
<clip>


I've been using the Tab shortcut for quite sometime now. I can't 
remember if I found it accidentally or not... it doesn't matter. What 
matters is that it WORKS. I save a lot of time using it.

The more I thought about my 'aliasing' idea last night, the closer to 
your opinion I found myself..... and then there was your reply. We don't 
need to confuse the code and make it unreadable. It's not so hard to 
type out the keywords, especially if we have the Tab feature built into 
the editor. Perhaps those working on other operating systems can push to 
have this functionality placed into their editor?

-Sam


Post a reply to this message

From: Florian Brucker
Subject: Re: How about $ for declare?
Date: 14 Aug 2004 13:30:23
Message: <411e4c2f$1@news.povray.org>
> Also, though this doesn't help those on open-source ports of PoV-Ray, the
> Windows users of PoV-Ray have that lovely in-built editor.  All one need do
> on WinPov is type "sph" then press Tab, and you have your complete word.
> Try it with "pig" as well!
Dunno about povmode for emacs etc., but if you're using QtPOVEditor 
(qtpoveditor.sf.net), you have that auto-complete-thingy for both 
keywords and custom identifiers.


I normally don't like full-quotes, but I got the impression that if 
everyone anticipating in this discussion right now would reread 
Christoph's post, there would not be much to discuss anymore:

"It leads to awfully obfuscated code. [...] With the same arguments you 
could replace every  other keyword with the shortest unique abbreviation 
- but no one could read the code any more then."

So, think again - how much time do you really spend with typing only 
when you're creating a POV scene? IMHO POV SDL allows some pretty 
cryptic stuff already (and yes, I'm using that, too ;) so there's no 
need to make it even more complicated.

While talking about SDL changes, the only thing that one would IMHO 
benefit from is the #set keyword from former MegaPOV, combined with an 
error/warning when trying to re-declare already declared identifiers.

Florian (who would like to have references in POV-SDL, too ;)


Post a reply to this message

From: Jim Charter
Subject: Re: How about $ for declare?
Date: 14 Aug 2004 15:40:12
Message: <411e6a9c$1@news.povray.org>
Rafal 'Raf256' Maj wrote:
> run### [at] runevisioncom news:411e20a7$1@news.povray.org
> 
> 
>>Try to type the following (where *TAB* means pressing TAB):
>>light*TAB**TAB*
> 
> 
> Oh, I thought that You where talking about this ctlr+space thingy, this 
> definetely should be in FAQ, help and Tip of the day.
> 
> But I still suggest shortucts for most long expressions, for example 
> reflection -> refl 
> specular .5 roughness 0.01  -> spec .5, 0.01
> 
> etc... why not?
> 
Because the full English words are standard and self-documenting
Because it adds unnecessary complication to every aspect of the endeavour
Because it would in no way result in better pictures
Because it is a bloat-feature based in a bloat mentality


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: How about $ for declare?
Date: 14 Aug 2004 16:46:34
Message: <411e7a2a@news.povray.org>
In article <411e6a9c$1@news.povray.org> , Jim Charter <jrc### [at] msncom> 
wrote:

>> etc... why not?
>>
> Because the full English words are standard and self-documenting
> Because it adds unnecessary complication to every aspect of the endeavour
> Because it would in no way result in better pictures
> Because it is a bloat-feature based in a bloat mentality

Very well said!

    Thorsten

____________________________________________________
Thorsten Froehlich
e-mail: mac### [at] povrayorg

I am a member of the POV-Ray Team.
Visit POV-Ray on the web: http://mac.povray.org


Post a reply to this message

From: Rafal 'Raf256' Maj
Subject: Re: How about $ for declare?
Date: 14 Aug 2004 17:17:32
Message: <Xns9545ED4602E3Craf256com@203.29.75.35>
jrc### [at] msncom news:411e6a9c$1@news.povray.org

> Because the full English words are standard and self-documenting

cone { begin_point x*4  end_point 5*x  radius 10 }

this is self-documented

> Because it adds unnecessary complication to every aspect of the endeavour

I dont know what endeavour is, but as for implementation the basic aliases 
are very easy to implement

> Because it would in no way result in better pictures

More comfortable work = more time to concentrate on picture itself.

> Because it is a bloat-feature based in a bloat mentality

?

-- 
http://www.raf256.com/3d/
Rafal Maj 'Raf256', home page - http://www.raf256.com/me/
Computer Graphics


Post a reply to this message

From: Rafal 'Raf256' Maj
Subject: Re: How about $ for declare?
Date: 14 Aug 2004 17:20:30
Message: <Xns9545EDC67E010raf256com@203.29.75.35>
spa### [at] raf256com news:Xns9545ED4602E3Craf256com@203.29.75.35

(...)

but anyway I do not insist so hard about aliases, since Tab future is 
greate, if only it would be implemented also in linux-editors...

-- 
http://www.raf256.com/3d/
Rafal Maj 'Raf256', home page - http://www.raf256.com/me/
Computer Graphics


Post a reply to this message

From: Greg M  Johnson
Subject: Re: How about $ for declare?
Date: 14 Aug 2004 21:11:57
Message: <411eb85d$1@news.povray.org>
agreed.

"Jim Charter" <jrc### [at] msncom> wrote in message
news:411e6a9c$1@news.povray.org...
> Rafal 'Raf256' Maj wrote:
> > run### [at] runevisioncom news:411e20a7$1@news.povray.org
> >
> >
> >>Try to type the following (where *TAB* means pressing TAB):
> >>light*TAB**TAB*
> >
> >
> > Oh, I thought that You where talking about this ctlr+space thingy, this
> > definetely should be in FAQ, help and Tip of the day.
> >
> > But I still suggest shortucts for most long expressions, for example
> > reflection -> refl
> > specular .5 roughness 0.01  -> spec .5, 0.01
> >
> > etc... why not?
> >
> Because the full English words are standard and self-documenting
> Because it adds unnecessary complication to every aspect of the endeavour
> Because it would in no way result in better pictures
> Because it is a bloat-feature based in a bloat mentality


Post a reply to this message

From: Doppelganger
Subject: Re: How about $ for declare?
Date: 14 Aug 2004 23:35:20
Message: <411ed9f8$1@news.povray.org>
>More comfortable work = more time to concentrate on picture itself.

this is only true for short term work. though I'm not a POV-Ray expert, my
experience with other languages in which shorthand syntax exists makes me
say that it's only "comfortable work" for 2 or 3 lines worth of code in
every 500. The code with dense shorthand easily becomes cluttered and
impossible to read.

Giving an example of how bad short hand can be in Mathematica code (and I
tried using this sort of code for serious programming -- to give up
reasonably soon afterwards):

Compare:

f[x_]=x^2;
list=Map[f,{1,2,3,4}];
Apply[Plus,list];
list

With:

Plus@@((#^2)&/@{1,2,3,4})

they both get the list {1, 2, 3, 4}, square all entries, and sum all the
entries. Which code segment do you think you'd understand for what it is 2
months after you'd written it? I had to rtfm to get the second one right to
make this point (though I wrote fluently like it when I used it), whereas
the first one came naturally.

> > Because it is a bloat-feature based in a bloat mentality
>
> ?

it's a non-feature. It's not necessary, hardly useful, and it makes (as
illustrated) for more hard than good.


Post a reply to this message

From: Nicolas Alvarez
Subject: Re: How about $ for declare?
Date: 15 Aug 2004 23:10:17
Message: <41202599@news.povray.org>
So it's not so good idea. I AM lazy but you are right.

--
- Nicolas Alvarez
nicoalvar0 [at] hotmail [dot] com


"Brian Elliott" <NotForSpam@AskIfUWant> escribió en el mensaje
news:411de774@news.povray.org...
> "Samuel Benge" <stb### [at] hotmailcom> wrote in message
> news:411### [at] hotmailcom...
> > Rafal 'Raf256' Maj wrote:
> > >
> > > Btw, how about adding some shorten forms for long and often used
> keywords,
> > > it could spedd up typing and comforable level of hand-typing .pov
code,
> > > like
> >
> > Better yet, why not have the ability to make new #aliases for keywords.
> > Something like this:
> >
> > #alias sphere=sph;
> >
> > sph{ <0,0,0>, 10 pigment{White} }
> >
> > -Sam
> >
>
> Hello all,
>
> Some cautionary words.
>
> Aliasing sounds really beguiling, because being IT/Comp/Sci/Tech types,
> we're all lazy when it comes to typing and repetition, and we tend to
like
> using the shortest sequence of keystrokes to create our code.   :-)
>
> But on reflection (argh a RT pun), I believe it could unleash a bad genie
on
> the PoV-Ray community.  The genie's curse will be reduced legibility and
> portability of the SDL.
>
> Human nature being what it is, what'll happen is that the single PoV-Ray
> language we have now will be replaced by a multitude of personal
dialects,
> as people make up whatever words they personally enjoy.  Instead of
> "sphere", some will use "sph"; or "sp"; and there will be those who
> particularly enjoy terse and dense code, who will condense it to a mere
"s".
> Authors from non-English origins might customise the SDL for their own
> convenience, and use, eg., "esfera" instead!
>
> This is perfectly fine if it is confined to one's own bedroom or study,
but
> there's an intensely active and diverse community around PoV-Ray and,
let's
> face it, this code will be shared on the Internet!
>
> When reading someone else's aliased code, to ensure you understand their
> typography, you must first seek and refer to their dictionary before you
can
> to understand the SDL body -eg. When this author writes "sp" on line 145
of
> "myscene.pov" or "includefile3.inc", does it mean a "sphere" or a
"spline"
> or a locally-declared object type?
>
> Also, consider portability:  Incorporating aliased segments of another
> author's code into your work, which is either not aliased or uses
different
> conventions, will no longer be a simple drop-in operation -- it will be
much
> harder to port.
>
> Imagine using code from three sources, created with three different
> conventions.  What will you have to do to get it to work in your designs?
> Especially if their "dictionary" is tucked away in a minor include file
> somewhere, or it's spread across multiple files of hundreds of lines.  If
> one of your sources aliased "sphere" with "sp" while another had aliased
> "spline" with "sp", and you are trying to merge the two into a new scene
or
> into your whole code library, you have a real mess to sort out!!!
>
> The end effect:  I think there are many people who would discard such
code
> rather then face the extra time and frustration of translating it.  Great
> ideas could be discarded or not even looked at, because the author used
> idiosyncratic language.  The free community exchange of ideas that
happens
> now would probably be reduced if aliasing were common, and I think that
> would be a great pity if it happened.
>
> Alternately, if you had aliased code and wanted to offer your creation
into
> the public community, you might have to convert it bact to standard
syntax
> first, nullifying any gains you originally got from it, either in
time-saved
> or visuals.
>
> My sense of it is that the disadvantages eventually outweigh the
advantages.
>
> $0.02
> Cheers,
>   Brian
>
>


Post a reply to this message

From: Nicolas Alvarez
Subject: Re: How about $ for declare?
Date: 15 Aug 2004 23:14:05
Message: <4120267d@news.povray.org>
I'm working on a typing test (in HTML and Javascript). It's a modification
of one found in http://javascriptsource.com.

If you are interested, mail me.

--
- Nicolas Alvarez
nicoalvar0 [at] hotmail [dot] com


"Severi Salminen" <sev### [at] NOT_THISsibafi> escribió en el mensaje
news:411df175$1@news.povray.org...
> > I did a little experiment just now, and I succeded in typing "sphere "
(with
> > trailing space) 19 times in 30 seconds, and that was WITH correcting
several
> > mistakes.
>
> I did 30 "sphere"s/30secs after a few practice runs. So, what is the
> POV-Ray community unofficial record? Only correctly typed words count.
>
> I also think that there is little to gain by using aliasing. Also, how
> many people knows how to use TAB (at least in windows version) to use
> autocomplete feature? It also speeds up writing.
>
> Severi


Post a reply to this message

From: Groucho
Subject: Re: How about $ for declare?
Date: 16 Aug 2004 10:35:24
Message: <4120c62c$1@news.povray.org>
I agree that what a language needs is legibility. From my point of view, C++
lost that long time ago ... but this is a different history.

Talking about legibility, I would like to know why the directives sitll need
the simbol #. I know that they are interpreted during parsing time and so on
but I think that many of our scenes have more lines beginning with # than
the opposite. Belive me, with some keyboards, it is a difficult symbol.

Why not writing:
declare i=0;
while (i<10)
    sphere {(0,0,i) i/2}
    i=i+1;
end

There should be many problems for the interpreter?

Thx,
Groucho

"Doppelganger" <ped### [at] netcabopt> wrote in message
news:411ed9f8$1@news.povray.org...
> >More comfortable work = more time to concentrate on picture itself.
>
> this is only true for short term work. though I'm not a POV-Ray expert, my
> experience with other languages in which shorthand syntax exists makes me
> say that it's only "comfortable work" for 2 or 3 lines worth of code in
> every 500. The code with dense shorthand easily becomes cluttered and
> impossible to read.
>
> Giving an example of how bad short hand can be in Mathematica code (and I
> tried using this sort of code for serious programming -- to give up
> reasonably soon afterwards):
>
> Compare:
>
> f[x_]=x^2;
> list=Map[f,{1,2,3,4}];
> Apply[Plus,list];
> list
>
> With:
>
> Plus@@((#^2)&/@{1,2,3,4})
>
> they both get the list {1, 2, 3, 4}, square all entries, and sum all the
> entries. Which code segment do you think you'd understand for what it is 2
> months after you'd written it? I had to rtfm to get the second one right
to
> make this point (though I wrote fluently like it when I used it), whereas
> the first one came naturally.
>
> > > Because it is a bloat-feature based in a bloat mentality
> >
> > ?
>
> it's a non-feature. It's not necessary, hardly useful, and it makes (as
> illustrated) for more hard than good.
>
>


Post a reply to this message

From: Ross
Subject: Re: How about $ for declare?
Date: 16 Aug 2004 10:36:43
Message: <4120c67b$1@news.povray.org>
"Rafal 'Raf256' Maj" <spa### [at] raf256com> wrote in message
news:Xns954536876C74raf256com@203.29.75.35...
> chr### [at] gmxde news:cfjc1l$vh2$1@chho.imagico.de
>
> > other keyword with the shortest unique abbreviation - but no one could
> > read the code any more then.
>
> Btw, how about adding some shorten forms for long and often used keywords,
> it could spedd up typing and comforable level of hand-typing .pov code,
> like
>
> light { y*10 rgb 1 }
> diff {
>   box { -5, +5 }
>   sphere { 0 10 }
>   text {
>   pig { bozo cmap{0:<1,0,0> .5:<1,1,0> 1:1} }
>   norm{ bozo .5 }
>   fin { refl .5 phong 0.5,70 spec 0.1,0.06 }
> }
>
> ?
>
> Aliasing keyword is probably easy, another format of for example color_map
> perhaps not so much.
>
> Just an idea.
>

How about using a text editor that supports word completion. something like
what the tab key does in bash or a myriad of other programs. It' smuch
simpler and doesn't subject other people to your whims of what a language
should be.

-r


Post a reply to this message

From: Ross
Subject: Re: How about $ for declare?
Date: 16 Aug 2004 10:47:13
Message: <4120c8f1$1@news.povray.org>
"Rafal 'Raf256' Maj" <spa### [at] raf256com> wrote in message
news:Xns9545EDC67E010raf256com@203.29.75.35...
> spa### [at] raf256com news:Xns9545ED4602E3Craf256com@203.29.75.35
>
> (...)
>
> but anyway I do not insist so hard about aliases, since Tab future is
> greate, if only it would be implemented also in linux-editors...
>
> -- 
> http://www.raf256.com/3d/
> Rafal Maj 'Raf256', home page - http://www.raf256.com/me/
> Computer Graphics

emacs has symbol completion. one just needs to tell it what the symbols are
for the major mode you are in. i havn't even noticed if it works by default
in povmode for emacs. povmode definately has all the keywords needed,
because it performs syntax highlighting properly.


Post a reply to this message

From: Ross
Subject: Re: How about $ for declare?
Date: 16 Aug 2004 11:00:53
Message: <4120cc25@news.povray.org>
"Samuel Benge" <stb### [at] hotmailcom> wrote in message
news:411### [at] hotmailcom...
> Perhaps those working on other operating systems can push to
> have this functionality placed into their editor?
>
> -Sam
>

Vim and Emacs have the ability to have this functionality in general. What
other editors are there? ;)

What about the new qtpoveditor? does it have symbol completion?


Post a reply to this message

From: Brian Elliott
Subject: Re: How about $ for declare?
Date: 17 Aug 2004 08:07:09
Message: <4121f4ed$1@news.povray.org>
"Ross" <rli### [at] everestkcnet> wrote in message
news:4120cc25@news.povray.org...
> "Samuel Benge" <stb### [at] hotmailcom> wrote in message
> news:411### [at] hotmailcom...
> > Perhaps those working on other operating systems can push to
> > have this functionality placed into their editor?
> >
> > -Sam
> >
>
> Vim and Emacs have the ability to have this functionality in general. What
> other editors are there? ;)
>
> What about the new qtpoveditor? does it have symbol completion?

According to Florian, yes it does also!

Cheers,
    Brian


Post a reply to this message

From: selsek
Subject: Re: How about $ for declare?
Date: 20 Aug 2004 20:15:01
Message: <web.41269325ccee1183502b4aff0@news.povray.org>
Some suggestions:

-file starts with a #development [code]
-the [code] is in an ini file in pov-ray's directory, along with custom code
prefs (sphere=sp,...) (you may have several [codes])
-> on the computer with the [code], you'd see sp{0,1}, but on a computer
without the proper [code], or without the #development state, or in a text
editor, you'd see standard code.
So the translation would be done in pov.

A better interface!
1- customisable button bar (you would add links to files from insert menu:
add something in one click)
2- at least, a return on screen option (or have i missed it?)
3- an enhanced insert menu interface to the left of the screen (i wonder if
many on us use that part of the screen)
-see the right menu in 3ds/gmax/hamapatch? Like that, but to expand the
menus, you may use shortcut keys.

Example:
(initial menu, A,B=things like "light", "shape":)
[A - alt+a]
[B - alt+b]

(do alt+a:)
[A - alt+a]
  [sphere - ctrl+shift+s]
  [cylinder - ...]
[B - alt+b]

So if you can customise the shortcuts, the text editing will be MUCH faster,
and not so hard to use since you don't have to remember the shortcut keys.
Faster? you won't use the mouse anymore, won't have to use the arrows to
navigate in the insert menu

selsek


Post a reply to this message

From: Alain
Subject: Re: How about $ for declare?
Date: 20 Aug 2004 21:52:50
Message: <4126aaf2$1@news.povray.org>
selsek nous apporta ses lumieres ainsi en ce 20/08/2004 20:11... :

>Some suggestions:
>
>-file starts with a #development [code]
>-the [code] is in an ini file in pov-ray's directory, along with custom code
>prefs (sphere=sp,...) (you may have several [codes])
>-> on the computer with the [code], you'd see sp{0,1}, but on a computer
>without the proper [code], or without the #development state, or in a text
>editor, you'd see standard code.
>So the translation would be done in pov.
>
>A better interface!
>1- customisable button bar (you would add links to files from insert menu:
>add something in one click)
>2- at least, a return on screen option (or have i missed it?)
>3- an enhanced insert menu interface to the left of the screen (i wonder if
>many on us use that part of the screen)
>-see the right menu in 3ds/gmax/hamapatch? Like that, but to expand the
>menus, you may use shortcut keys.
>
>Example:
>(initial menu, A,B=things like "light", "shape":)
>[A - alt+a]
>[B - alt+b]
>
>(do alt+a:)
>[A - alt+a]
>  [sphere - ctrl+shift+s]
>  [cylinder - ...]
>[B - alt+b]
>
>So if you can customise the shortcuts, the text editing will be MUCH faster,
>and not so hard to use since you don't have to remember the shortcut keys.
>Faster? you won't use the mouse anymore, won't have to use the arrows to
>navigate in the insert menu
>
>selsek
>
>
>  
>
OK. You propose a _display_ user defined substitution of selected 
keywords. That way, you can use whatever personal shorthand you want, 
while still outputing normal code. The support for that will make the 
editor biger and more prone to bugs. Maybe somebody can make a patched 
version to test it...

Alain


Post a reply to this message

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