Introspection: Difference between revisions
Content deleted Content added
m →{{header|Retro}}: update for retro12 |
|||
Line 1,776: | Line 1,776: | ||
=={{header|Retro}}== |
=={{header|Retro}}== |
||
This will exit if the |
This will exit if the version is less than 2019.6: |
||
<lang Retro> |
<lang Retro>@Version #201906 lt+ &bye if</lang> |
||
⚫ | |||
A better way is to check the build number. This will exit if the build is lower than |
|||
the 11.0 release: |
|||
<lang Retro |
<lang Retro> |
||
⚫ | |||
~~~ |
|||
⚫ | |||
⚫ | |||
⚫ | |||
<lang Retro> |
|||
⚫ | |||
⚫ | |||
⚫ | |||
'bloop 'n:abs [ find nip ] bi@ and |
|||
[ |
[ 'bloop executeByName 'n:abs executeByName ] if |
||
~~~</lang> |
|||
Retro has no direct way to check for data types of functions. Assuming that a word class is defined for integer variables, we could do something like this: |
Retro has no direct way to check for data types of functions. Assuming that a word class is defined for integer variables, we could do something like this: |
||
<lang Retro> |
<lang Retro> |
||
#0 #0 [ dup d:class fetch &class:integer eq? [ d:xt fetch + [ n:inc ] dip ] [ drop ] choose ] d:for-each |
|||
</lang> |
</lang> |
||