Just another update

This commit is contained in:
Ingy döt Net 2015-02-20 00:35:01 -05:00
parent a25938f123
commit 00a190b0a6
6591 changed files with 94363 additions and 23227 deletions

View 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.

View file

@ -0,0 +1,7 @@
MODULE ProgramName;
IMPORT
NPCT:Args,
Out;
BEGIN
Out.Object("Program name: " + Args.Get(0));Out.Ln
END ProgramName.

View file

@ -0,0 +1,2 @@
use FindBin;
print "Program name $FindBin::Script\n";

View file

@ -1,4 +1,4 @@
#!/usr/bin/env ruby
puts "Path: #{$0}"
puts "Path: #{$PROGRAM_NAME}" # or puts "Path: #{$0}"
puts "Name: #{File.basename $0}"

View 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")}")
}

View file

@ -1,2 +1,2 @@
#!/usr/local/bin/txr
#!/usr/local/bin/txr -B
@(bind my-name @*self-path*)