Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#21 change parameter declaration syntax...

open
nobody
None
5
2003-04-21
2003-04-21
Steve Wampler
No

I realize this is likely to be too late to be possible,
but I'd like
to propose changing the procedure/method parameter
declaration syntax. Instead of:

procedure f(a:b:c)

make it:

procedure f(a:b=c)

where the : and/or the = modifier are optional.
The : modifier would denote a required type, while
the = modifier would denote a default value.

This would:

(a) lexically distinguish the functionally *different*
concepts of type checking and default value,
which is a Very Good Thing from a usability POV.
(b) Allow default values to become arbitrary expressions
instead of just constants.
(c) Make it (slightly) easier to implement type checking
that is really type checking.

Discussion

  • Charles Evans
    Charles Evans
    2003-05-18

    Logged In: YES
    user_id=436876

    This would be one way to allow a default
    value of list() or myrecord() or table()