Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

optional methods

3 views
Skip to first unread message

Raoul Duke

unread,
Mar 19, 2025, 7:38:37 PMMar 19
to pi...@googlegroups.com
For an interface defining procedures/methods, optionality is a nightmare long term if you ask me. What are the best semantic& syntactic ways to support such things? (The closer to static typing the better, even if it is some advanced thing like multistaged gradual typing or dependent types or having to do it all in CoQ or whatever!) Debugging why something does/not exist at runtime is fairly often a nightmare. 

David Barbour

unread,
Mar 26, 2025, 9:58:07 AMMar 26
to pi...@googlegroups.com
For optional arguments, it's convenient to have keyword arguments and defaults.

In context of method overrides and extensions and such, it seems better that the defaults are part of the method rather than the caller. This allows overriding and extending the defaults. 

But another good approach seems to involve modeling functions as 'parsing' their arguments. Closer to OMeta or Prolog.
Reply all
Reply to author
Forward
0 new messages