On Tue, Feb 28, 2012 at 8:22 AM, Noah Silva
<shir...@galapagossoftware.com> wrote:
>
> If you want to convince people to use FPC and are having issues, you should
> ask them what features, exactly, they are looking for.  Chances are that FPC
> has them.  (If they want a functional language, though, then you're out of
> luck).

Pascal is not entirely opposed to being a functional language. There
are two missing language features (consider it a proposal of
Functional Pascal):

(1) A declaration part, that parallels "var", with keyword "val" or
"let" (since "val" is taken up by a procedure). It introduces named
values, i.e. non-assignable variables. The part after "=" can be any
expression. Therefore, this feature spoils the "declaration --
implementation divide" that is dear to Pascal.

(2) Closures. That is, making local functions that only use "const"
arguments and "val / let" variables safe to return from the outer
function. This can be done by allocating the "val / let" data on the
heap, or perhaps easier by copying them into an implicitly built
object and interpreting the returned local function as pointer to
method of this object. The closure-object would be memory-managed as
other objects.

What do you think?
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to