In Python we can write:
'
something = true // or false
value = "foo" if something else "bar"
'
As you might imagine, its equivalent in pure Ring is:
something = true // or false
if something = true
value = "foo"
else
value = "bar"
ok
But what if we write it, the Python-way, in Ring, using Softanza?
To to that, we just need to decorate the Python code with vr(), vl(), _if(), _else() and v() functions:
bSomething = TRUE
vr([ :value ]) '=' vl([ "foo" ]) _if(bSomething) _else([ "bar" ])
? v(:value)
#--> foo
And if we turn bSomething to FALSE:
bSomething = FALSE
vr([ :value ]) '=' vl([ "foo" ]) _if(bSomething) _else([ "bar" ])
? v(:value)
#--> bar
A snapshot of the sample in Ring Notepad:

All the best,
Mansour
--
---
You received this message because you are subscribed to the Google Groups "The Ring Programming Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ring-lang+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ring-lang/5f1932b4-51db-46c4-b993-113505067cf8n%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ring-lang/f23e5d03-5b41-4d3a-be78-00e8130a2088n%40googlegroups.com.