POV-Ray : Newsgroups : povray.beta-test : number of parameters in functions Server Time
13 Nov 2024 01:57:04 EST (-0500)
  number of parameters in functions (Message 1 to 6 of 6)  
From:
Subject: number of parameters in functions
Date: 19 Sep 2001 08:24:42
Message: <kc3hqtkgj93f82rpkj6puvlj8f5cs7nk0q@4ax.com>
platform info: Info: WinNT4, PII 233, 128MB, POV3.5b2

I wrote such code:

  #declare func=function(h){h^h}
  #local New=function{func(1)}

and it works, therefore I changed it to:

  #declare func=function{1+2+3}
  #local New=function{func()}

it stoped with note that operand expected (what is nonsense for me)
but I'm mad and I joined both as:

  #declare func=function(h){h^h}
  #local New=function{func(1)}
  #declare func=function{1+2+3}
  #local New=function{func()}

and POV 3.5b2 crashed

ABX


Post a reply to this message

From: Anders K 
Subject: Re: number of parameters in functions
Date: 19 Sep 2001 08:48:51
Message: <3ba89433$1@news.povray.org>
> but I'm mad and I joined both as:
>
>   #declare func=function(h){h^h}
>   #local New=function{func(1)}
>   #declare func=function{1+2+3}
>   #local New=function{func()}
>
> and POV 3.5b2 crashed

I can confirm this. Win98, Athlon 700, 256MB, beta 2.

PVENGINE caused an invalid page fault in
module PVENGINE.EXE at 0167:0046539d.
Registers:
EAX=00000101 CS=0167 EIP=0046539d EFLGS=00010202
EBX=00000000 SS=016f ESP=0222fbdc EBP=000001ea
ECX=00000101 DS=016f ESI=00000001 FS=437f
EDX=0000000e ES=016f EDI=00007530 GS=0000
Bytes at CS:EIP:
8b 50 04 51 52 eb 07 8b 44 24 7c 50 6a 00 8b 7c
Stack dump:
00000001 00000101 000001ea 00000000 00000001 c16ae450 0222fc20 bff8c806
005ae200 00bc4880 0000003d 00416f39 00000001 00000001 005944cc 00000001


Post a reply to this message

From: Adrien Beau
Subject: Re: number of parameters in functions
Date: 19 Sep 2001 11:05:07
Message: <3BA8B421.D667F622@sycomore.fr>
I have not read anything about functions yet, but something
in your code puzzles me. Either you or the POV-Team got it
wrong.

you wrote:
> 
> and it works, therefore I changed it to:
> 
>   #declare func=function{1+2+3}
>   #local New=function{func()}

I feel it should be:

#declare func=function(){1+2+3}
#local New=function{func()}

Again, I've not yet read the docs, but the () are generically
needed for functions without parameters.

Anyway, POV should issue a warning, not crash, so there's
a at least a bug.

-- 
Adrien Beau - adr### [at] freefr - http://adrien.beau.free.fr
 Mes propos n'engagent que moi et en aucun cas mes employeurs


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: number of parameters in functions
Date: 19 Sep 2001 11:39:28
Message: <3ba8bc30@news.povray.org>

Skiba <abx### [at] babilonorg>  wrote:

>   #declare func=function{1+2+3}
>   #local New=function{func()}
>
> it stoped with note that operand expected (what is nonsense for me)

Well, it would help if at this point you would have RTFM:
The first one declared a function with _three_ parameters, the later tries
to pass _zero_ parameters.  It make ***not*** sense to have a function with
_zero_ parameters and thus it is not allowed.

> but I'm mad and I joined both as:
>
>   #declare func=function(h){h^h}
>   #local New=function{func(1)}
>   #declare func=function{1+2+3}
>   #local New=function{func()}

You are right that it should not crash, I will look into it.

    Thorsten

____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trfde

Visit POV-Ray on the web: http://mac.povray.org


Post a reply to this message

From:
Subject: Re: number of parameters in functions
Date: 20 Sep 2001 03:35:48
Message: <7g5jqtsieacpeffsaugnb6rkgforkgi7qs@4ax.com>
On Wed, 19 Sep 2001 11:39:21 -0400, "Thorsten Froehlich"
<tho### [at] trfde> wrote:

> In article <kc3hqtkgj93f82rpkj6puvlj8f5cs7nk0q@4ax.com> , Wlodzimierz ABX 
> Skiba <abx### [at] babilonorg>  wrote:
>
> >   #declare func=function{1+2+3}
> >   #local New=function{func()}
> >
> > it stoped with note that operand expected (what is nonsense for me)
>
> Well, it would help if at this point you would have RTFM:
> The first one declared a function with _three_ parameters, the later tries
> to pass _zero_ parameters.  It make ***not*** sense to have a function with
> _zero_ parameters and thus it is not allowed.

Yes, I'm a programer and I understand that zero parameters is nonsesne
and should be replaced with simple expresion withoud function{} shell
but I can imagine some beginners in POV without any programing
knowledge who can tread functions as only set of letter and they can
write such thing and wonder why he should add (x,y,z) if it is not
used inside and is constant.
It is just suggestion to add warning when inside function is only
float expression. Warning could contain note that user rather should
replace function{} with only float and/or should remeber that it is
function with 3 parameters. I think that it could even use sentence
from documentation: "The minimum number of parameters is 1."
Note this says about function and not point to () neither {}.
I hope my english was enough.

> You are right that it should not crash, I will look into it.

Thanks

ABX


Post a reply to this message

From: Mike Williams
Subject: Re: number of parameters in functions
Date: 27 Nov 2001 13:08:26
Message: <mASevBACa7A8Ew8e@econym.demon.co.uk>
Wasn't it W3odzimierz ABX Skiba who wrote:
>platform info: Info: WinNT4, PII 233, 128MB, POV3.5b2
>
>I wrote such code:
>
>  #declare func=function(h){h^h}
>  #local New=function{func(1)}
>
>and it works, therefore I changed it to:
>
>  #declare func=function{1+2+3}
>  #local New=function{func()}
>
>it stoped with note that operand expected (what is nonsense for me)
>but I'm mad and I joined both as:
>
>  #declare func=function(h){h^h}
>  #local New=function{func(1)}
>  #declare func=function{1+2+3}
>  #local New=function{func()}
>
>and POV 3.5b2 crashed
>


I've just been doing a bit of checking through the known bugs list, and
can't seem reproduce this in beta 7.

I reckon that it's now fixed and intend to remove it from the known bugs
list.

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

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