#!/usr/bin/env openlisp -shell
(defun type-name (arg)
(class-name (class-of (or (ignore-errors (parse-number arg)) arg))))
(cond
((= $# 0)
(format (error-output) "Usage: ~A arg [arg...]~%" $0)
(end 1))
(t
(format t ";; OpenLisp v~a~%" (version))
(format t ";; Calling ~a with ~a argument(s).~%" $0 $#)
(format t "~%")
(format t ";; 1) as vector: ~a~%" $*)
(for ((i 1 (+ i 1)))
((> i $#))
(format t ";; arg~D: ~S ~S~%" i $i (type-name $i)))
(format t "~%")
(format t ";; 2) as list: ~a~%" $@)
(dolist (x $@)
(format t ";; ~S ~S~%" x (type-name x)))))