Just another update
This commit is contained in:
parent
a25938f123
commit
00a190b0a6
6591 changed files with 94363 additions and 23227 deletions
6
Task/Topic-variable/Clojure/topic-variable.clj
Normal file
6
Task/Topic-variable/Clojure/topic-variable.clj
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
user=> 3
|
||||
3
|
||||
user=> (Math/pow *1 2)
|
||||
9.0
|
||||
user=> (Math/pow *2 0.5)
|
||||
1.7320508075688772
|
||||
2
Task/Topic-variable/J/topic-variable-2.j
Normal file
2
Task/Topic-variable/J/topic-variable-2.j
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
(*:, %:) 3
|
||||
9 1.73205
|
||||
5
Task/Topic-variable/Python/topic-variable.py
Normal file
5
Task/Topic-variable/Python/topic-variable.py
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
>>> 3
|
||||
3
|
||||
>>> _*_, _**0.5
|
||||
(9, 1.7320508075688772)
|
||||
>>>
|
||||
6
Task/Topic-variable/REXX/topic-variable.rexx
Normal file
6
Task/Topic-variable/REXX/topic-variable.rexx
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
/*REXX pgm shows something close to a "topic variable" (for funcs/subs).*/
|
||||
parse arg N /*get an arg from CL, maybe a 3? */
|
||||
say mysub(N) ' ◄───' /*invoke a function to square it.*/
|
||||
exit /*stick a fork in it, we're done.*/
|
||||
/*──────────────────────────────────MYSUB subroutine (function)─────────*/
|
||||
mysub: return arg(1)**2 /*return the square of passed arg*/
|
||||
7
Task/Topic-variable/Ruby/topic-variable-1.rb
Normal file
7
Task/Topic-variable/Ruby/topic-variable-1.rb
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
while DATA.gets # assigns to $_ (local scope)
|
||||
print # If no arguments are given, prints $_
|
||||
end
|
||||
__END__
|
||||
This is line one
|
||||
This is line two
|
||||
This is line three
|
||||
4
Task/Topic-variable/Ruby/topic-variable-2.rb
Normal file
4
Task/Topic-variable/Ruby/topic-variable-2.rb
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
DATA.gets
|
||||
p [$_.to_i ** 2, Math.sqrt($_.to_i)] #=> [9, 1.7320508075688772]
|
||||
__END__
|
||||
3
|
||||
7
Task/Topic-variable/Standard-ML/topic-variable.ml
Normal file
7
Task/Topic-variable/Standard-ML/topic-variable.ml
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
- 3.0;
|
||||
val it = 3.0 : real
|
||||
- it * it;
|
||||
val it = 9.0 : real
|
||||
- Math.sqrt it;
|
||||
val it = 3.0 : real
|
||||
-
|
||||
Loading…
Add table
Add a link
Reference in a new issue