POV-Ray : Newsgroups : povray.off-topic : My first C++ program : Re: A test Server Time
1 Oct 2024 09:23:13 EDT (-0400)
  Re: A test  
From: andrel
Date: 20 Sep 2008 16:14:22
Message: <48D559E7.2000105@hotmail.com>
On 20-Sep-08 21:30, Darren New wrote:
> andrel wrote:
>> why would want you distinguish reserved words, variables and functions?
>> In C(++) they might be implemented quite differently, that does not 
>> mean however that are fundamentally different on a conceptual level.
> 
> I'm pretty sure "reserved words" are conceptually quite different from 
> variables, yes. 

Indeed, but only if you assume you have a language that makes that 
distinction. It is not a concept that is inherently a part of any 
language. Maths does not have 'reserved words'. I.e. for the casual 
observer things like '=' and '+' looks as though they are universally 
defined and understood the same way. In practice even these are 
sometimes redefined to suit a specific field or application in a way 
that may even go deeper than overloading. Many operators are also 
'reserved words' in certain subfields and not existent in others. If you 
want to model a language on the way mathematics is used, defining 
'reserved words' is something you might want to leave out.

> Unless you're talking about an extensible language like 
> LISP or FORTH or Tcl, the reserved words let you do things that you 
> can't do with functions and variables, and vice versa.

I think that FORTH introduced me to the idea that it makes sense to 
introduce user level control flow mechanisms.

> Knowing what's an argument and what's a function is also pretty 
> important for understanding how a given line of code works. 

Again absolutely true, for a imperative language. In lambda calculus and 
any functional language derived from that this distinction make no sense 
at all.

> If you can't 
> look at the code and figure out which function bodies get evaluated, it 
> makes it really rough to work out what's going on, even in a functional 
> language.

I don't think so. If you have an entity called current_temperature it 
should not matter if that is derived by looking at a specific memory 
location (a variable), by looking at an index in a circular buffer 
(array) or by doing something more complicated like calling a function 
of generating an interrupt. OK, it does matter sometimes but only in an 
implementation. It should not have any influence on understanding the 
code conceptually.


I think you understood that my mean reason for my response was that Warp 
is looking with imperative spectacles to lines of code in a functional 
language and desperately trying to force it into his own mindframe. Then 
again, he might just be pulling Andy's legs. I know he does that 
sometimes and I have not followed the entire thread.


Post a reply to this message

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