Raven Manual - Making Decisions
Those who know Forth's if ( flag -- ) and else ( -- ) will be at home. Just forget about then as the indentation handles the defining of code blocks.
# Integer comparison 1 2 = if 'Equal' else 'Not Equal' # String comparison 'hello' 'world' = if 'Equal' else 'Not Equal' # Regex testing 'hello' m/[aeiou]/ if 'A vowel!' else 'No vowels :(' # Useful operators 1 1 = && 2 2 = if 'Both equal' else 'One pair not equal' 1 1 = || 2 2 = if 'One pair equal' else 'Neither pair equal'
|