From aab753da48170e64a81f60ef3930486c9a9f310a Mon Sep 17 00:00:00 2001 From: HAYAMA Kaoru <3752189+hymkor@users.noreply.github.com> Date: Tue, 12 Aug 2025 02:45:56 +0900 Subject: [PATCH] example.lsp: replace `(catch 'fail)` to `(block main)` --- example.lsp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/example.lsp b/example.lsp index 89f41ad..1b965b2 100644 --- a/example.lsp +++ b/example.lsp @@ -1,8 +1,8 @@ -(catch 'fail +(block main (if (< (length *argv*) 2) (progn (format (error-output) "Usage: ~A ~A USERNAME@DOMAIN PASSWORD~%" *executable-name* *program-name*) - (throw 'fail nil))) + (return-from main nil))) (let ((account (car *argv*)) (password (cadr *argv*)) @@ -11,8 +11,8 @@ (with-handler (lambda (c) (format (error-output) "ssh is not found~%") - (throw 'fail nil)) (setq sshpid (spawn "ssh" account))) + (return-from main nil)) (expect* ("[fingerprint])?" @@ -23,17 +23,17 @@ (sendln password)) (("Connection refused" "Could not resolve hostname") - (throw 'fail nil)) + (return-from main nil)) (30 (format (error-output) "TIME OUT~%") - (throw 'fail nil))) + (return-from main nil))) (expect* ("Permission denied" (expect "password:") (send #\U3) (wait sshpid) - (throw 'fail nil) + (return-from main nil) ) ("$ ")) (sendln "echo YOU CAN CALL SOME COMMAND HERE")