From 97da1a8af721cbca77329aeec520f1d94704d45a Mon Sep 17 00:00:00 2001 From: HAYAMA Kaoru <3752189+hymkor@users.noreply.github.com> Date: Sat, 16 Aug 2025 19:18:26 +0900 Subject: [PATCH] README: Add usages of `(block)`, `(return-from)` and `(apply)` --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index 979f5e8..49b499c 100644 --- a/README.md +++ b/README.md @@ -123,6 +123,16 @@ Parameters enclosed in curly braces {...} are optional and can be omitted. The matched string in an `(expect*)` block. - `(catch TAG-FORM FORM...)` and `(throw TAG-FORM RESULT-FORM)` - Non-local exits. See also [ISLISP draft - 14.7. Non-local exits](https://islisp-dev.github.io/ISLispHyperDraft/islisp-v23.html#non_local_exits) +- `(block TAG FORM...)` and `(return-from TAG VALUE)` + - Defines a block with a tag TAG. `(return-from TAG VALUE)` exits from the block early, returning VALUE. Useful for controlling flow within a section of code without exiting the entire script. +- `(apply FUNCTION ARG-LIST)` + - Calls FUNCTION with arguments supplied as a list ARG-LIST. + Useful when the number of arguments is dynamic or collected in a list. + Example: + ```lisp + (setq args (list "-p" "2222" "user@host")) + (apply #'spawn "ssh" args) ; equivalent to (spawn "ssh" "-p" "2222" "user@host") + ``` - `(with-handler HANDLER FORM...)` - When an error occurs in `FORMS...`, call `HANDLER`. See also [ISLISP Draft - Operations relating to condition handling](https://islisp-dev.github.io/ISLispHyperDraft/islisp-v23.html#s_with_handler)