Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Niidae Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
JOSS
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===Expressions and propositions=== A unique feature of JOSS was its handling of logical expressions. Most computer languages offer some way to form a multi-part mathematical expression, for instance, {{code|Set x{{=}}(1+2)Β·3.}} which sets the variable x to the value 9. JOSS expanded on this concept by clearly defining the concept of the "proposition", an expression that returns a logical value, true or false, instead of a numeric one. They were mostly seen in {{code|If}} statements, as in the examples above, but the Boolean value could also be stored in a variable directly,{{sfn|Gimble|1967|p=77}} or one could convert true to 1 and false to 0 using the {{code|tv}} (truth value) function.{{sfn|Gimble|1967|p=24, 69}} In addition to propositions, JOSS also had the concept of "conditional expressions". These consisted of strings of propositions along with code that would run if that proposition was true. This allowed multi-step decision trees to be written in a single line. They serve a purpose similar to the [[?:|ternary operator]] found in modern languages like [[C programming language|C]] or [[Java programming language|Java]], where they are used to return a value from a compact structure implementing [[if-then-else]]. JOSS' version has any number of conditionals, not just three, so it is more of a compact [[switch statement]] than a compact if-then.{{sfn|Gimble|1967|p=75}} This example recreates the function of the {{code|sgn}} function:{{sfn|Marks|1971|p=41}} Let s(x)=[x=0:0; x>0:1; x<0:-1]. This defines a function "s" which takes a single parameter, "x", and makes three consecutive tests against it. Whichever test succeeds first returns the corresponding value after the colon.{{sfn|Gimble|1967|p=25}}
Summary:
Please note that all contributions to Niidae Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Encyclopedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
JOSS
(section)
Add topic