POV-Ray : Newsgroups : povray.newusers : Is there a "string length" function? : Re: Is there a "string length" function? Server Time
31 Jul 2024 10:22:46 EDT (-0400)
  Re: Is there a "string length" function?  
From: Warp
Date: 23 Feb 2003 10:09:25
Message: <3e58e425@news.povray.org>
Will W <wil### [at] nospamwizzardsnet> wrote:
> Organizing functions by return type is, for me, an intriguing idea.

  There's a very good reason for this in programming, as I explained
previously.
  In the same way as a variable has a type (eg. a variable of integer type),
a function has a type as well. The type of the function is determined by
its return value. Also constant literals have a type as well.
  The type of something determines where it can be used. For example, if
an integer is expected in a particular place, then any item of integer
type can be used there (ie. an integer literal, an integer variable, an
integer function or an expression which result is an integer).

  The purpose of a function (eg. to manipulate strings or whatever) is
a higher-level concept which has nothing to do with its type. The parameters
the function takes have nothing to do with its type (they don't affect in
any way *where* you can use the function).

  Organizing functions by their type is the easiest and most unambiguous
way of doing it. There are some functions which are very hard to classify
by their higher-level concept (because it's not unambiguous or it's a very
unique function).

-- 
#macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}//  - Warp -


Post a reply to this message

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