Path: csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: minforth Newsgroups: comp.lang.forth Subject: Re: 0 vs. translate-none Date: Wed, 24 Sep 2025 10:36:29 +0200 Lines: 36 Message-ID: References: <2025Sep17.185305@mips.complang.tuwien.ac.at> <20250919193929.00000ec0@tin.it> <2025Sep20.092554@mips.complang.tuwien.ac.at> <20250920103435.00002fbe@tin.it> <2025Sep23.192305@mips.complang.tuwien.ac.at> <2025Sep24.083826@mips.complang.tuwien.ac.at> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: individual.net 2ZQDM5BzxoiHt/ysKhblLQDVVQEMU3B8TJCSDeGZz5gxccDNcl Cancel-Lock: sha1:m1AWg0z8p7x0q3YyO0F5hqYFnz4= sha256:lE07JMA0pPfTojqX1xAzW1z58yuB7pzfwaCuRXpBmWk= User-Agent: Mozilla Thunderbird In-Reply-To: <2025Sep24.083826@mips.complang.tuwien.ac.at> Xref: csiph.com comp.lang.forth:134205 Am 24.09.2025 um 08:38 schrieb Anton Ertl: > minforth writes: >> Am 23.09.2025 um 19:23 schrieb Anton Ertl: >>> minforth writes: >>>> FWIW I also use suffixes for recognizers: >>>> let M be a matrix >>>> M´ auto-transposed >>>> M~ auto-inverted >>> >>> Can you give an example of a matrix with your matrix recognizer? >>> >> >> To be fair, here MinForth displays the matrix/vector stack in the >> QUIT prompt: >> >> MinForth 3.6 (64 bit) (fp matrix) >> # 0 0 matrix mat ok >> # m[ 1 2 3 ; 4 5 6 ] ok > > Given this syntax, a parsing word M[ suggests itself to me (although I > generally dislike parsing words and probably would choose a different > syntax); or maybe a word that switches to a matrix interpreter > (possibly implemented using the recognizer words, with ] switching > back. Why did you choose to use a recognizer? M[ ... pushes a matrix literal onto the matrix stack. MATRIX (or VECTOR) define a persistent matrix/vector value. M[ is not really parsing, it just sets a flag for the forth interpreter. You could write M[ 1 fdup ] instead of M[ 1 1 ] or M[ 1. 1. ] or M[ 1e 1e ] IOW M[ does not use a recognizer.