Just another update
This commit is contained in:
parent
a25938f123
commit
00a190b0a6
6591 changed files with 94363 additions and 23227 deletions
16
Task/Program-name/Mercury/program-name.mercury
Normal file
16
Task/Program-name/Mercury/program-name.mercury
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
:- module program_name.
|
||||
:- interface.
|
||||
|
||||
:- import_module io.
|
||||
:- pred main(io::di, io::uo) is det.
|
||||
|
||||
:- implementation.
|
||||
|
||||
main(!IO) :-
|
||||
% The first argument is used as the program name if it is not otherwise
|
||||
% available. (We could also have used the predicate io.progname_base/4
|
||||
% if we did not want path preceding the program name.)
|
||||
io.progname("", ProgName, !IO),
|
||||
io.print_line(ProgName, !IO).
|
||||
|
||||
:- end_module program_name.
|
||||
7
Task/Program-name/Oberon-2/program-name.oberon-2
Normal file
7
Task/Program-name/Oberon-2/program-name.oberon-2
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
MODULE ProgramName;
|
||||
IMPORT
|
||||
NPCT:Args,
|
||||
Out;
|
||||
BEGIN
|
||||
Out.Object("Program name: " + Args.Get(0));Out.Ln
|
||||
END ProgramName.
|
||||
2
Task/Program-name/Perl/program-name-2.pl
Normal file
2
Task/Program-name/Perl/program-name-2.pl
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
use FindBin;
|
||||
print "Program name $FindBin::Script\n";
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/env ruby
|
||||
|
||||
puts "Path: #{$0}"
|
||||
puts "Path: #{$PROGRAM_NAME}" # or puts "Path: #{$0}"
|
||||
puts "Name: #{File.basename $0}"
|
||||
|
|
|
|||
5
Task/Program-name/Scala/program-name.scala
Normal file
5
Task/Program-name/Scala/program-name.scala
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
object ScriptName extends App {
|
||||
println(s"Program of instantiated object: ${this.getClass.getName}")
|
||||
// Not recommended, due various implementations
|
||||
println(s"Program via enviroment: ${System.getProperty("sun.java.command")}")
|
||||
}
|
||||
|
|
@ -1,2 +1,2 @@
|
|||
#!/usr/local/bin/txr
|
||||
#!/usr/local/bin/txr -B
|
||||
@(bind my-name @*self-path*)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue