POV-Ray : Newsgroups : povray.off-topic : I'm in the mood for monads : Re: Living in a box Server Time
29 Jul 2024 14:21:16 EDT (-0400)
  Re: Living in a box  
From: Invisible
Date: 25 Apr 2012 04:07:07
Message: <4f97b0ab$1@news.povray.org>
On 25/04/2012 06:08 AM, Darren New wrote:
> On 4/23/2012 1:05, Invisible wrote:
>>> There are lots of languages that let you can pass a function as an
>>> argument.
>>
>> Heh. I bet most of them are scripting languages though. :-P
>
> Not really. Arguably, even C allows it, C++, C# allows a delegate which
> is essentially the same thing, and yes, bunches of interpreted languages.

C and C++ have function pointers. It's dubious whether functions are 
"first class", but certainly you can pass them as arguments.

C# presumably allows /everything/.

Java allows you to use the reflection API to create an object that 
represents a function method, and to invoke that method. Alternatively 
you can use anonymous inner classes. (The fact that this feature even 
/exists/ tells you how badly Java programmers want anonymous functions.)

Pascal? Forget it.

Eiffel? Well, they have "delegates", which are sort-of the same thing.

Come to think of it, I don't actually /know/ any other compiled languages...

Obviously, any random scripting languages supports eval() and so 
trivially supports first-class functions.


Post a reply to this message

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