|
|
|
|
|
by oldandtired
3266 days ago
|
|
Depending on your system, 1(1) is quite sensible, That is applying 1 to a list of parameters just returns the 1st parameter. This is a matter of the semantics that one uses when application is run against any value. 1(1) -> 1 Just because the common idea of application is that it only applies to functions does not mean that application applied to other types is nonsensical and should end up with a runtime error. If your language allows application to be defined for different types, then the type system should be capable of determining the type that returns from application. A practical example of a language in which application is valid for integers is Unicon/Icon. Both functions and integers have specific semantics with regards to application. And failure is an option. |
|