Add tasks for all the new languages
This commit is contained in:
parent
9dc3c2bb62
commit
bba7bfd280
13208 changed files with 134745 additions and 0 deletions
26
Task/Introspection/EchoLisp/introspection.echolisp
Normal file
26
Task/Introspection/EchoLisp/introspection.echolisp
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
(version)
|
||||
→ EchoLisp - 2.50.3
|
||||
📗 local-db: db.version: 3
|
||||
|
||||
(when (< (version) 2.6)
|
||||
(writeln "Please reload EchoLisp : CTRL-F5, CMD-R or other...")
|
||||
(exit))
|
||||
|
||||
(if (and (bound? 'bloop) (bound? 'abs) (procedure? abs))
|
||||
(abs bloop) 'NOT-HERE)
|
||||
→ NOT-HERE
|
||||
|
||||
(define bloop -777)
|
||||
→ bloop
|
||||
(if (and (bound? 'bloop) (bound? 'abs) (procedure? abs)) (abs bloop) 'NOT-HERE)
|
||||
→ 777
|
||||
|
||||
(for/sum ((kv (environment-bindings user-initial-environment )))
|
||||
#:when (integer? (second kv))
|
||||
(writeln kv)
|
||||
(second kv))
|
||||
|
||||
("bloop" -777)
|
||||
("gee" 555)
|
||||
("buzz" 333)
|
||||
→ 111 ;; sum
|
||||
5
Task/Introspection/Lasso/introspection-1.lasso
Normal file
5
Task/Introspection/Lasso/introspection-1.lasso
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
var(bloob = -26)
|
||||
|
||||
decimal(lasso_version(-lassoversion)) < 9.2 ? abort
|
||||
|
||||
var_defined('bloob') and $bloob -> isa(::integer) and lasso_tagexists('math_abs') ? math_abs($bloob)
|
||||
15
Task/Introspection/Lasso/introspection-2.lasso
Normal file
15
Task/Introspection/Lasso/introspection-2.lasso
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
var(
|
||||
bloob = -26,
|
||||
positive = 450
|
||||
)
|
||||
|
||||
local(total = integer)
|
||||
|
||||
with v in var_keys
|
||||
// Lasso creates a number of thread variables that all start with an underscore. We don't want those
|
||||
where not(string(#v) -> beginswith('_')) and var(#v) -> isa(::integer)
|
||||
do {
|
||||
#total += var(#v)
|
||||
}
|
||||
|
||||
#total
|
||||
5
Task/Introspection/Lingo/introspection-1.lingo
Normal file
5
Task/Introspection/Lingo/introspection-1.lingo
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
put _player.productVersion
|
||||
-- "11.5.9"
|
||||
|
||||
_player.itemDelimiter="."
|
||||
if integer(_player.productVersion.item[1])<11 then _player.quit()
|
||||
6
Task/Introspection/Lingo/introspection-2.lingo
Normal file
6
Task/Introspection/Lingo/introspection-2.lingo
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
-- check existance of bloop in local scope
|
||||
bloopExists = not voidP(value("bloop"))
|
||||
-- or for global scope:
|
||||
-- bloopExists = not voidP(_global.bloop)
|
||||
absExists = value("abs(1)")=1
|
||||
if bloopExists and absExists then put abs(bloop) -- or abs(_global.bloop)
|
||||
10
Task/Introspection/Lingo/introspection-3.lingo
Normal file
10
Task/Introspection/Lingo/introspection-3.lingo
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
cnt = 0
|
||||
sum = 0
|
||||
repeat with v in the globals
|
||||
if integerP(v) then
|
||||
cnt = cnt + 1
|
||||
sum = sum + v
|
||||
end if
|
||||
end repeat
|
||||
put cnt
|
||||
put sum
|
||||
6
Task/Introspection/Nim/introspection.nim
Normal file
6
Task/Introspection/Nim/introspection.nim
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
echo NimVersion
|
||||
|
||||
var bloop = -12
|
||||
|
||||
when compiles abs(bloop):
|
||||
echo abs(bloop)
|
||||
12
Task/Introspection/Oforth/introspection.oforth
Normal file
12
Task/Introspection/Oforth/introspection.oforth
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
: bloopAbs
|
||||
| bl m |
|
||||
System.VERSION println
|
||||
|
||||
Word find("bloop") ->bl
|
||||
bl isA(Constant) ifFalse: [ "bloop constant does not exist" println return ]
|
||||
|
||||
"abs" asMethod ->m
|
||||
m ifNull: [ "abs method does not exist" println return ]
|
||||
|
||||
System.Out "bloop value is : " << bl value << cr
|
||||
System.Out "bloop abs is : " << bl value m perform << cr ;
|
||||
Loading…
Add table
Add a link
Reference in a new issue