variable = (condition) ? value1 : value2;
So, let's take a snippet from the web, say:
n = -12;
sign = (n > 0) ? "positive" : "negative";
printf(sign);
#--> negative
n = -12;
vr(:sign) '=' b(n > 0) '?' bv("positive", "negative");
printf( v(:sign) );
#--> negative
Here is the sample running in my Ring Notepad...


vr( :name, :age, :job ) '=' vl([ "Mansour", 47, "Programmer"])
? v(:age) #--> 47
--
---
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/14671bb6-a527-4cad-85ab-a47e53470774n%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ring-lang/d37dae83-8ea5-44de-af0c-6beb39f66db4n%40googlegroups.com.
n = -12;
vr(:sign) '=' b(n > 0) '??' bv("positive", "negative");
printf( v(:sign) );
#--> negative
To view this discussion on the web visit https://groups.google.com/d/msgid/ring-lang/b9125901-3b1b-4e3e-ac2c-196e98d5371en%40googlegroups.com.


To view this discussion on the web visit https://groups.google.com/d/msgid/ring-lang/6807e423-9148-40e7-a569-f57c8b6d463cn%40googlegroups.com.