From: "Ethan Gardener" <eekee57@fastmail.fm>
To: 9fans <9fans@9fans.net>
Subject: Re: [9fans] Alternative to fine-grained mouse usage?
Date: Sat, 03 Jul 2021 22:33:07 +0100 [thread overview]
Message-ID: <4f18b8a7-7f6f-43b2-a3a9-e783efd584cd@www.fastmail.com> (raw)
In-Reply-To: <B751F843-B867-4FB4-B1B3-BBF5B8BA2F0D@hotmail.co.uk>
[-- Attachment #1: Type: text/plain, Size: 2830 bytes --]
On Sat, Jul 3, 2021, at 5:32 PM, silas poulson wrote:
>> On 2 Jul 2021, at 19:06, Ethan Gardener <eekee57@fastmail.fm> wrote:
>>
>> This reminds me why I switched to Forth: I can program my editor properly
>
> Could you expand on this point?
>
> Vaguely aware of Forth, but no experience with forth editors
Sure. There's a few things.
I like and sometimes make use of the fact that the input language is a full systems language. I can access all the editor's variables and memory from the input prompt or from my own code. Sometimes it blows up because Forth has even fewer safeguards than C, but I soon learned how to avoid the explosions. It helps that I now use a Forth which displays the stack contents before each prompt; I do recommend that. All this can be summarized with a little misquote: "[Forth] does not prevent you doing stupid things because that would also prevent you doing clever things." ;) Sometimes I wish for type safety, but now I've learned to do without it, it's fine.
Other than that, I make some use of the data stack: I've written several words to leave string references on the stack for use by other words, chaining them together almost like a pipeline. Sam can do things like this so it's not too new, but I can chain anything I like and easily write new commands. I don't always chain them on the same line. If there's a memory copy or blank operation in there, I'll check the parameters look right first. The check doesn't take a second.
Where Sam executes commands in braces "at the same time," not allowing you to change the order, I've got full control of the order of execution. In Sam, I was never successful in changing text with commands in braces. Sam or Acme would always report something about multiple changes at the same time, and Sam would corrupt the text a bit. I don't remember exactly what I was trying to do, but I was sure it would have worked if my commands were executed in order. In Forth by contrast, there's nothing to get commands out of order. I may not be working on large files with complex commands any more, but I write sequences of simple commands all the time.
To be honest, it helps that the editor's source code is only about 2.5KB. ;) Some of that isn't even editor, it's block indexing and multi-block search, but I've replaced one and need to replace the other. Actually, I should rewrite the editor seeing as I don't want my code GPL-licensed and the editor probably is. ("Probably"? There's no license in the editor itself, likely because it's hard to fit licensing boilerplate into 1KB blocks.)
------------------------------------------
9fans: 9fans
Permalink: https://9fans.topicbox.com/groups/9fans/T716c5aa0e2aa8a27-Mdaa9427b1343b7aa707c8979
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription
[-- Attachment #2: Type: text/html, Size: 4982 bytes --]
next prev parent reply other threads:[~2021-07-03 21:33 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-01 1:15 Dworkin Muller
2021-07-01 2:51 ` umbraticus
2021-07-01 4:36 ` Paul Lalonde
2021-07-01 5:05 ` umbraticus
2021-07-01 10:36 ` hiro
2021-07-03 9:09 ` Dworkin Muller
2021-07-03 9:31 ` hiro
2021-07-01 11:12 ` igor
2021-07-01 17:48 ` Ethan Gardener
2021-07-01 18:01 ` Sigrid Solveig Haflínudóttir
2021-07-01 21:59 ` [9fans] Sam tricks (was: Alternative to fine-grained mouse usage?) Silas McCroskey
2021-07-02 15:03 ` [9fans] Alternative to fine-grained mouse usage? silas poulson
2021-07-02 18:06 ` Ethan Gardener
2021-07-02 18:54 ` Silas McCroskey
2021-07-03 2:29 ` umbraticus
2021-07-03 11:52 ` Ethan Gardener
2021-07-03 11:48 ` Ethan Gardener
2021-07-03 16:32 ` silas poulson
2021-07-03 21:33 ` Ethan Gardener [this message]
2021-07-03 23:19 ` Dworkin Muller
2021-07-04 9:42 ` Ethan Gardener
2021-07-02 2:20 ` Cyber Fonic
2021-07-07 3:14 ` Lyndon Nerenberg (VE7TFX/VE6BBM)
2021-07-12 4:01 ` Dworkin Muller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4f18b8a7-7f6f-43b2-a3a9-e783efd584cd@www.fastmail.com \
--to=eekee57@fastmail.fm \
--cc=9fans@9fans.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).