File tree Expand file tree Collapse file tree 5 files changed +24
-17
lines changed Expand file tree Collapse file tree 5 files changed +24
-17
lines changed Original file line number Diff line number Diff line change 3
3
; ; Alternatively, load a local cl-portable.lisp script.
4
4
#- quicklisp (load " cl-portable.lisp" :print nil )
5
5
6
- (use-package ' cl-portable)
6
+ (import ' cl-portable::argument-script)
7
+ (import ' cl-portable::argument-vector)
8
+ (import ' cl-portable::quit-with-status)
7
9
8
- ; ; Simulate main function.
10
+ ; ; Simulate a main function.
9
11
(defun main ()
10
12
; ; Print out unprocessed arguments.
11
13
(write-line " Unprocessed argument vector:" )
17
19
(write-line " Processed argument(s) in scripting mode:" )
18
20
(write-line (princ-to-string (argument-script)))
19
21
20
- #+ ccl (finish-output ) ; ; Trick for Clozure CL.
22
+ #+ ccl (finish-output ) ; Trick for Clozure CL.
21
23
(quit-with-status))
22
24
23
- ; ; Assume args.lisp runs in scripting mode .
25
+ ; ; Call the main function .
24
26
(main)
Original file line number Diff line number Diff line change 3
3
; ; Alternatively, load a local cl-portable.lisp script.
4
4
#- quicklisp (load " cl-portable.lisp" :print nil )
5
5
6
- (use-package ' cl-portable)
6
+ (import ' cl-portable::compile-program)
7
+ (import ' cl-portable::platform)
8
+ (import ' cl-portable::quit-with-status)
7
9
8
10
; ; Simulate a main function.
9
11
(defun main ()
10
12
(write-line " Hello World" )
11
- ; ; Trick for Clozure CL.
12
- #+ ccl (finish-output )
13
+ #+ ccl (finish-output ) ; Trick for Clozure CL.
13
14
(quit-with-status 0 ))
14
15
15
- ; ; Set a proper executable name
16
- ; ; according to current OS.
16
+ ; ; Set a proper executable name according to current OS.
17
17
(if (equal :windows (platform))
18
18
(defvar *program* " program.exe" )
19
19
(defvar *program* " program" ))
20
20
21
+ ; ; Compile the script into an executable.
21
22
(compile-program *program* #' main)
23
+ ; ; Quit the script.
22
24
(quit-with-status)
Original file line number Diff line number Diff line change 3
3
; ; Alternatively, load a local cl-portable.lisp script.
4
4
#- quicklisp (load " cl-portable.lisp" :print nil )
5
5
6
- (use-package ' cl-portable)
6
+ (import ' cl-portable::env)
7
+ (import ' cl-portable::platform)
8
+ (import ' cl-portable::quit-with-status)
7
9
8
10
; ; Simulate a main function.
9
11
(defun main ()
10
- (if (equal (platform) :windows )
12
+ (if (equal :windows (platform))
13
+ ; ; HOME equivalent on Windows
11
14
(write-line (env " USERPROFILE" ))
12
15
(write-line (env " HOME" )))
13
- #+ ccl (finish-output )
16
+ #+ ccl (finish-output ) ; Trick for Clozure CL.
14
17
(quit-with-status 0 ))
15
18
16
19
; ; Load the main function.
Original file line number Diff line number Diff line change 3
3
; ; Alternatively, load a local cl-portable.lisp script.
4
4
#- quicklisp (load " cl-portable.lisp" :print nil )
5
5
6
- (use-package ' cl-portable)
6
+ (import ' cl-portable::quit-with-status )
7
7
8
8
; ; Simulate a main function.
9
9
(defun main ()
10
10
(write-line " 你好,世界" )
11
11
(write-line " こんにちは世界" )
12
12
(write-line " 안녕 세상" )
13
- ; ; Trick for Clozure CL.
14
- #+ ccl (finish-output )
13
+ #+ ccl (finish-output ) ; Trick for Clozure CL.
15
14
(quit-with-status 0 ))
16
15
17
16
; ; Load the main function.
Original file line number Diff line number Diff line change 3
3
; ; Alternatively, load a local cl-portable.lisp script.
4
4
#- quicklisp (load " cl-portable.lisp" :print nil )
5
5
6
- (use-package ' cl-portable)
6
+ (import ' cl-portable::pwd)
7
+ (import ' cl-portable::quit-with-status)
7
8
8
9
; ; Simulate a main function.
9
10
(defun main ()
10
11
(write-line (princ-to-string (pwd)))
11
- #+ ccl (finish-output )
12
+ #+ ccl (finish-output ) ; Trick for Clozure CL.
12
13
(quit-with-status 0 ))
13
14
14
15
; ; Load the main function.
You can’t perform that action at this time.
0 commit comments