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
24
Task/Stack-traces/Lasso/stack-traces-1.lasso
Normal file
24
Task/Stack-traces/Lasso/stack-traces-1.lasso
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
// Define our own trace method
|
||||
define trace => {
|
||||
local(gb) = givenblock
|
||||
|
||||
// Set a depth counter
|
||||
var(::_tracedepth)->isnota(::integer) ? $_tracedepth = 0
|
||||
handle => {$_tracedepth--}
|
||||
|
||||
// Only output when supplied a capture
|
||||
#gb ? stdoutnl(
|
||||
// Indent
|
||||
('\t' * $_tracedepth++) +
|
||||
|
||||
// Type + Method
|
||||
#gb->self->type + '.' + #gb->calledname +
|
||||
|
||||
// Call site file
|
||||
': ' + #gb->home->callsite_file +
|
||||
|
||||
// Line number and column number
|
||||
' (line '+#gb->home->callsite_line + ', col ' + #gb->home->callsite_col +')'
|
||||
)
|
||||
return #gb()
|
||||
}
|
||||
8
Task/Stack-traces/Lasso/stack-traces-2.lasso
Normal file
8
Task/Stack-traces/Lasso/stack-traces-2.lasso
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
define stackexample => type {
|
||||
public oncreate => trace => { return self }
|
||||
public inner => trace => { }
|
||||
public middle => trace => { .inner }
|
||||
public outer => trace => { .middle }
|
||||
}
|
||||
|
||||
stackexample->outer
|
||||
6
Task/Stack-traces/Nim/stack-traces.nim
Normal file
6
Task/Stack-traces/Nim/stack-traces.nim
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
proc g() =
|
||||
writeStackTrace()
|
||||
proc f() =
|
||||
g()
|
||||
|
||||
f()
|
||||
6
Task/Stack-traces/Oforth/stack-traces.oforth
Normal file
6
Task/Stack-traces/Oforth/stack-traces.oforth
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
: f1 Exception throw("An exception") ;
|
||||
Integer method: f2 self f1 ;
|
||||
: f3 f2 ;
|
||||
: f4 f3 ;
|
||||
|
||||
10 f4
|
||||
Loading…
Add table
Add a link
Reference in a new issue