Introspection: Difference between revisions
no edit summary
SqrtNegInf (talk | contribs) m (→{{header|Perl 6}}: just 'v6') |
No edit summary |
||
Line 1,808:
/*──────────────────────────────────────────────────────────────────────────────────────*/
syntax: return 1</lang>
=={{header|Ring}}==
<lang ring>
# Project: Introspection
# Date : 2018/07/13
# Author: Gal Zsolt (~ CalmoSoft ~)
# Email : <calmosoft@gmail.com>
if version() < 1.8
see "Version is too old" + " (" + version() + ")" + nl
else
see "Version is uptodate" + " (" + version() + ")" + nl
ok
bloop = 5
if isglobal("bloop") = 1
see "Variable " + "'bloop'" + " exists" + nl
else
see "Variable " + "'bloop'" + " doesn't exist" + nl
ok
if isglobal("bleep") = 1
see "Variable " + "'bleep'" + " exists" + nl
else
see "Variable " + "'bleep'" + " doesn't exist" + nl
ok
if isfunction("abs") = 1
see "Function " + "'abs'" + " is defined" + nl
else
see "Function " + "'abs'" + " is not defined" + nl
ok
if isfunction("abc") = 1
see "Function " + "'abc'" + " is defined" + nl
else
see "Function " + "'abc'" + " is not defined" + nl
ok
func abs(bloop)
return fabs(bloop)
</lang>
Output:
<pre>
Version is uptodate (1.8)
Variable 'bloop' exists
Variable 'bleep' doesn't exist
Function 'abs' is defined
Function 'abc' is not defined
</pre>
=={{header|Ruby}}==
|