[mercury-users] Perl shift || $defalt
Terrence Brannon
princepawn at earthlink.net
Thu Apr 26 21:37:44 AEST 2001
In Perl, it is very easy to say the following:
the value of x is equal to the first data item in ARGV,
or if ARGV is not defined then use the value 12:
$x = shift || 12;
print "$x\n";
Thus, a program can either take values on STDIN or use hardcoded
defaults with relative ease.
Could someone show how to do this same thing in Mercury?
--------------------------------------------------------------------------
mercury-users mailing list
post: mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe: Address: mercury-users-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------
More information about the users
mailing list