POV-Ray : Newsgroups : povray.unofficial.patches : Idea for functions Server Time
1 Nov 2024 23:14:19 EDT (-0400)
  Idea for functions (Message 1 to 10 of 17)  
Goto Latest 10 Messages Next 7 Messages >>>
From: Warp
Subject: Idea for functions
Date: 5 May 2000 06:53:03
Message: <3912a80f@news.povray.org>
How about adding support for variables, conditionals (if) and loops (while)
to functions (used in isosurfaces, pigments...)?
  This would enhance a lot the possibilities of the functions. It would allow,
for example, making a Mandelbrot pattern function.

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

From: Chris Huff
Subject: Re: Idea for functions
Date: 5 May 2000 08:26:49
Message: <chrishuff_99-4B3035.07300205052000@news.povray.org>
In article <3912a80f@news.povray.org>, Warp <war### [at] tagpovrayorg> 
wrote:

> How about adding support for variables, conditionals (if) and loops 
> (while) to functions (used in isosurfaces, pigments...)?
> This would enhance a lot the possibilities of the functions. It would 
> allow, for example, making a Mandelbrot pattern function.

There is already an if() "statement", it is a function. As I remember, 
the syntax is like this: if(CONDITION, IF_VAL, ELSE_VAL)
Support for variables and other flow control would be very useful, but I 
suspect it would require rewriting a large portion of the function code. 
I don't understand much of it though, I could be wrong.

-- 
Christopher James Huff - Personal e-mail: chr### [at] yahoocom
TAG(Technical Assistance Group) e-mail: chr### [at] tagpovrayorg
Personal Web page: http://chrishuff.dhs.org/
TAG Web page: http://tag.povray.org/


Post a reply to this message

From: pk
Subject: Re: Idea for functions
Date: 5 May 2000 16:48:43
Message: <391333B4.E567C11F@videotron.ca>
Chris Huff wrote:
> 
> In article <3912a80f@news.povray.org>, Warp <war### [at] tagpovrayorg>
> wrote:
> 
> > How about adding support for variables, conditionals (if) and loops
> > (while) to functions (used in isosurfaces, pigments...)?
> > This would enhance a lot the possibilities of the functions. It would
> > allow, for example, making a Mandelbrot pattern function.
> 
> There is already an if() "statement", it is a function. As I remember,
> the syntax is like this: if(CONDITION, IF_VAL, ELSE_VAL)
> Support for variables and other flow control would be very useful, but I
> suspect it would require rewriting a large portion of the function code.
> I don't understand much of it though, I could be wrong.
Oh, well... You could probably do a Basic interpreter(not gwbasic...
QBasic would be good...)... It's got fast results, is turing complete,
not hard to learn, and isn't too hard to interpret, if you drop all
unneeded functions...
Or, you could also allow system calls... (function(system("/[whatever]",
x))

Both would work, but a basic interpreter is completely portable...
--
AKA paul_virak_khuong at yahoo.com, pkhuong at deja.com, pkhuong at
crosswinds.net and pkhuong at technologist.com(list not complete)...


Post a reply to this message

From: Chris Huff
Subject: Re: Idea for functions
Date: 5 May 2000 17:03:37
Message: <chrishuff_99-1D34EA.16065105052000@news.povray.org>
In article <391333B4.E567C11F@videotron.ca>, pk <thi### [at] videotronca> 
wrote:

> Oh, well... You could probably do a Basic interpreter(not gwbasic...
> QBasic would be good...)... It's got fast results, is turing complete,
> not hard to learn, and isn't too hard to interpret, if you drop all
> unneeded functions...

I have never seen BASIC referred to as "fast" before...and I fail to see 
the point in supporting a language like BASIC when an extension of the 
existing syntax would be sufficient.


> Or, you could also allow system calls... (function(system("/[whatever]",
> x))

How would that be useful for this application? Or are you talking about 
something similar to the current "DLL" functions?

-- 
Christopher James Huff - Personal e-mail: chr### [at] yahoocom
TAG(Technical Assistance Group) e-mail: chr### [at] tagpovrayorg
Personal Web page: http://chrishuff.dhs.org/
TAG Web page: http://tag.povray.org/


Post a reply to this message

From: pk
Subject: Re: Idea for functions
Date: 5 May 2000 20:16:37
Message: <3913646F.CAC6BCA2@videotron.ca>
Chris Huff wrote:
> 
> In article <391333B4.E567C11F@videotron.ca>, pk <thi### [at] videotronca>
> wrote:
> 
> > Oh, well... You could probably do a Basic interpreter(not gwbasic...
> > QBasic would be good...)... It's got fast results, is turing complete,
> > not hard to learn, and isn't too hard to interpret, if you drop all
> > unneeded functions...
> 
> I have never seen BASIC referred to as "fast" before...and I fail to see
> the point in supporting a language like BASIC when an extension of the
> existing syntax would be sufficient.
Well, first basic isn't slower than anything else when it's not
compiled, i think... compiled, it can often be faster(see PowerBasic:
dos version comparable to C compilers, windows version usually faster
than MSVC(and BCPP, i think)) 
> > Or, you could also allow system calls... (function(system("/[whatever]",
> > x))
> 
> How would that be useful for this application? Or are you talking about
> something similar to the current "DLL" functions?
Nope, i'm talking about using external apps(.exe in wintel)... instead
of supporting a full blown language for function, just allow the user to
use the (compiled) language s/he wants to use to do the maths!
Instead of having to support everything you want POV's function language
to support, POV could just allow you to call an application, and take
the return value for result!!
--
AKA paul_virak_khuong at yahoo.com, pkhuong at deja.com, pkhuong at
crosswinds.net and pkhuong at technologist.com(list not complete)...


Post a reply to this message

From: Chris Huff
Subject: Re: Idea for functions
Date: 6 May 2000 12:08:09
Message: <chrishuff_99-BEA015.11112406052000@news.povray.org>
In article <3913646F.CAC6BCA2@videotron.ca>, pk <thi### [at] videotronca> 
wrote:

> Well, first basic isn't slower than anything else when it's not
> compiled, i think... compiled, it can often be faster(see PowerBasic:
> dos version comparable to C compilers, windows version usually faster
> than MSVC(and BCPP, i think)) 

Still, why support another language when extending the current one would 
work? Compiling it isn't feasible, a different compiler would have to be 
made for each platform, and someone would have to write the interpreter. 
And then people would have to learn another language to use it, instead 
of just learning the differences between it and normal POV syntax.
And BASIC just isn't the best kind of language for this sort of 
thing...I personally would choose a highly simplified C- or Java-like 
syntax.


> Nope, i'm talking about using external apps(.exe in wintel)... instead
> of supporting a full blown language for function, just allow the user to
> use the (compiled) language s/he wants to use to do the maths!
> Instead of having to support everything you want POV's function language
> to support, POV could just allow you to call an application, and take
> the return value for result!!

Well, I don't think there is cross-platform way of doing this. And the 
lack of control over what the external program could do could cause 
problems. And how useful would it really be? I can't think of any cases 
where it would really help...
Also, this sounds a lot like the #system patch...which won't be included 
in the official version or MegaPOV for these reasons.

-- 
Christopher James Huff - Personal e-mail: chr### [at] yahoocom
TAG(Technical Assistance Group) e-mail: chr### [at] tagpovrayorg
Personal Web page: http://chrishuff.dhs.org/
TAG Web page: http://tag.povray.org/


Post a reply to this message

From: pk
Subject: Re: Idea for functions
Date: 6 May 2000 16:35:24
Message: <3914821C.637D1F2E@videotron.ca>
Chris Huff wrote:
> 
> In article <3913646F.CAC6BCA2@videotron.ca>, pk <thi### [at] videotronca>
> wrote:
> > Nope, i'm talking about using external apps(.exe in wintel)... instead
> > of supporting a full blown language for function, just allow the user to
> > use the (compiled) language s/he wants to use to do the maths!
> > Instead of having to support everything you want POV's function language
> > to support, POV could just allow you to call an application, and take
> > the return value for result!!
> 
> Well, I don't think there is cross-platform way of doing this. And the
> lack of control over what the external program could do could cause
> problems. And how useful would it really be? I can't think of any cases
> where it would really help...
> Also, this sounds a lot like the #system patch...which won't be included
> in the official version or MegaPOV for these reasons.
Yup, that's exactly it...
Have i ever said that it would be cross-platform??
Heck, give the code if you want to, but maybe that you just want to do a
one-time time!
Well, it'd as useful as your idea of adding things to the language, one
time or another(we, humans, always want more ;-)
And, you don't have control to what moray plugins do, or over what
pov-ray patch do!
Has this ever stopped people using them?
--
AKA paul_virak_khuong at yahoo.com, pkhuong at deja.com, pkhuong at
crosswinds.net and pkhuong at technologist.com(list not complete)...


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: Idea for functions
Date: 6 May 2000 18:34:48
Message: <39149e08$1@news.povray.org>
In article <3912a80f@news.povray.org> , Warp <war### [at] tagpovrayorg>  wrote:

>   How about adding support for variables, conditionals (if) and loops (while)
> to functions (used in isosurfaces, pigments...)?
>   This would enhance a lot the possibilities of the functions. It would allow,
> for example, making a Mandelbrot pattern function.

This is will surely come in the future, maybe with POV-Ray 4.0 or so.


      Thorsten


Post a reply to this message

From: TonyB
Subject: Re: Idea for functions
Date: 6 May 2000 21:07:05
Message: <3914c1b9@news.povray.org>
<information tidbit absorbed>    :)


Post a reply to this message

From: Warp
Subject: Re: Idea for functions
Date: 8 May 2000 06:47:10
Message: <39169b2e@news.povray.org>
pk <thi### [at] videotronca> wrote:
: Oh, well... You could probably do a Basic interpreter

  Just to add support for loops and variables? I don't think it's necessary,
nor worth the efforts.

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

Goto Latest 10 Messages Next 7 Messages >>>

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