Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
JOSS
(section)
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}}
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)