Introspection: Difference between revisions
Content added Content deleted
(Added C++) |
Thundergnat (talk | contribs) (Rename Perl 6 -> Raku, alphabetize, minor clean-up) |
||
Line 88: | Line 88: | ||
There are 3 integer variables in the global scope |
There are 3 integer variables in the global scope |
||
Their sum is 1936 |
Their sum is 1936 |
||
=={{header|ALGOL 68}}== |
=={{header|ALGOL 68}}== |
||
Line 227: | Line 225: | ||
if IsFunc("abs") |
if IsFunc("abs") |
||
MsgBox % abs(bloop) |
MsgBox % abs(bloop) |
||
return</lang> |
return</lang> |
||
=={{header|AWK}}== |
=={{header|AWK}}== |
||
Line 296: | Line 294: | ||
doing this kind of check in a shell script and defining symbols |
doing this kind of check in a shell script and defining symbols |
||
such as HAVE_ABS which ''can'' be checked by the preprocessor. |
such as HAVE_ABS which ''can'' be checked by the preprocessor. |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
=={{header|C sharp|C#}}== |
=={{header|C sharp|C#}}== |
||
There has to be some caveats made with C#. There are no truly "global" variables - just publicly exported ones from individual classes/types. I chose to make a couple of public static variables in my program's class. Also, the "version" of the compiler is difficult to impossible to get at. There are no predefined compiler constants that can be compared against as in C/C++ but then again, it's hardly the thing that counts in C#. What really counts is the version of .NET and the framework you're working with since that determines what C++ features you can use and the various calls that can be made. Consequently, I check the .NET version to make sure it's past 4.0 and exit if not. |
There has to be some caveats made with C#. There are no truly "global" variables - just publicly exported ones from individual classes/types. I chose to make a couple of public static variables in my program's class. Also, the "version" of the compiler is difficult to impossible to get at. There are no predefined compiler constants that can be compared against as in C/C++ but then again, it's hardly the thing that counts in C#. What really counts is the version of .NET and the framework you're working with since that determines what C++ features you can use and the various calls that can be made. Consequently, I check the .NET version to make sure it's past 4.0 and exit if not. |
||
Line 394: | Line 383: | ||
<pre>bloop's abs value = 10 |
<pre>bloop's abs value = 10 |
||
2 exported ints which total to -30</pre> |
2 exported ints which total to -30</pre> |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
=={{header|Clojure}}== |
=={{header|Clojure}}== |
||
Line 410: | Line 410: | ||
(throw (Error. "Bad version")))) |
(throw (Error. "Bad version")))) |
||
</lang> |
</lang> |
||
=={{header|Common Lisp}}== |
=={{header|Common Lisp}}== |
||
Line 1,543: | Line 1,542: | ||
4 integers, sum = 74717 |
4 integers, sum = 74717 |
||
</pre> |
</pre> |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
=={{header|Phix}}== |
=={{header|Phix}}== |
||
Line 1,939: | Line 1,919: | ||
(unless (version<=? "5.3" (version)) (error "ancient version")) |
(unless (version<=? "5.3" (version)) (error "ancient version")) |
||
</lang> |
</lang> |
||
⚫ | |||
(formerly Perl 6) |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
=={{header|Raven}}== |
=={{header|Raven}}== |
||
Line 1,946: | Line 1,946: | ||
'bloop' GLOBAL keys in && 'abs' CORE keys in |
'bloop' GLOBAL keys in && 'abs' CORE keys in |
||
if bloop abs print</lang> |
if bloop abs print</lang> |
||
=={{header|Retro}}== |
=={{header|Retro}}== |
||
Line 2,107: | Line 2,106: | ||
if (bloop.isDefined) bloop.get.abs |
if (bloop.isDefined) bloop.get.abs |
||
}</lang> |
}</lang> |
||
=={{header|Slate}}== |
=={{header|Slate}}== |
||
No version string included inside the system presently. |
No version string included inside the system presently. |