POV-Ray : Newsgroups : povray.general : How about $ for declare? Server Time
3 Aug 2024 02:18:29 EDT (-0400)
  How about $ for declare? (Message 8 to 17 of 37)  
<<< Previous 7 Messages Goto Latest 10 Messages Next 10 Messages >>>
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


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



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

<<< Previous 7 Messages Goto Latest 10 Messages Next 10 Messages >>>

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