Niladic: Difference between revisions

From NARS2000
Jump to navigationJump to search
No edit summary
No edit summary
Line 5: Line 5:
&nbsp;&nbsp;&nbsp;&nbsp;∇ </big>'''</code>
&nbsp;&nbsp;&nbsp;&nbsp;∇ </big>'''</code>


This function would return a random number in the range 1 - 52, but it would not accept any argument, such as would be used for dealing a card in a game.
This function would return a random number in the range 1 - 52, but it would not accept any argument. Such a function might be useful in the case of dealing a card in a game since the number of cards is always the same.
 
Some System functions are niladic in that they return a value, but you do not present them an argument. The [[System Function TS|{quad}TS]] function returns the current time stamp, that is, the current date and time, but you cannot give it a date or time in order to, for example, change the date or time.


== See Also==
== See Also==

Revision as of 02:00, 28 February 2013

A function is niladic if it does not accept any arguments. For example:

    ∇ z←dealcard
[1]    z←? 52
    ∇

This function would return a random number in the range 1 - 52, but it would not accept any argument. Such a function might be useful in the case of dealing a card in a game since the number of cards is always the same.

Some System functions are niladic in that they return a value, but you do not present them an argument. The ⎕TS function returns the current time stamp, that is, the current date and time, but you cannot give it a date or time in order to, for example, change the date or time.

See Also