Deutsch English Français Italiano |
<20240828163641.223@kylheku.com> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!weretis.net!feeder8.news.weretis.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Kaz Kylheku <643-408-1753@kylheku.com> Newsgroups: comp.unix.shell,comp.unix.programmer,comp.lang.misc Subject: Re: Python (was Re: I did not inhale) Date: Wed, 28 Aug 2024 23:44:28 -0000 (UTC) Organization: A noiseless patient Spider Lines: 42 Message-ID: <20240828163641.223@kylheku.com> References: <uu54la$3su5b$6@dont-email.me> <va2vt0$3h3gj$1@dont-email.me> <va44rh$3p1l6$1@dont-email.me> <va45eq$3pkt9$1@dont-email.me> <va4aut$3q4g0$1@dont-email.me> <va4fbr$3qvij$1@dont-email.me> <va5108$3tmmd$1@dont-email.me> <va51ok$3tqr9$1@dont-email.me> <va5ec2$3vluh$1@dont-email.me> <va6q4g$c1a7$1@dont-email.me> <va6rpa$c6bg$1@dont-email.me> <va6se9$cb8e$1@dont-email.me> <20240826083330.00004760@gmail.com> <vaises$2k7o6$2@dont-email.me> <20240826155113.000005ba@gmail.com> <wwvo75eicla.fsf@LkoBDZeT.terraraq.uk> <vak9k9$2ujrs$1@dont-email.me> <valgpu$34s18$1@dont-email.me> <vannkg$3ig72$1@dont-email.me> <vanrd8$3j0vv$1@dont-email.me> <vantnp$3j94i$1@dont-email.me> <87le0gbczf.fsf@nosuchdomain.example.com> Injection-Date: Thu, 29 Aug 2024 01:44:29 +0200 (CEST) Injection-Info: dont-email.me; posting-host="ee676becc5cc43d653dc7d1580a96201"; logging-data="3850494"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19/Xc4DLQzlshMukfsICtfw/O6W3zWoYq8=" User-Agent: slrn/pre1.0.4-9 (Linux) Cancel-Lock: sha1:PJzCackYkQCsZtkVs8k8Wk+Fq+Y= Bytes: 3316 On 2024-08-28, Keith Thompson <Keith.S.Thompson+u@gmail.com> wrote: > Bart <bc@freeuk.com> writes: >> On 28/08/2024 19:48, David Brown wrote: >> But some of us devise (and, importanly, implement) languages of our >> own and can be more vocal about misfeatures in others. > > If I'm moving chunks of code around in a C or C++ program, from one > scope to another, I can get away with leaving the indentation as it is, > because all the compiler cares about is where the braces are. But I > *always* adjust the indentation to fit the code's new context. > > Python's use of indentation to indicate scoping just means that I have > to do what I would have done anyway. In a language with brackets or braces, the indentation can adjust itself for you. The proof of concept for this is the "parinfer" algorithm, for Lisp languages. Someone came up with this a bunch of years ago and now it's fairly widely implemented. Parinfer creates a real-time link between indentation and parentheses. It can be configured to infer one from the other: you can manually control indentation and have parentheses magically appear and disappear as needed, or you can control parentheses and have the code indent itself. Likely, a much more complicated version of the algorithm could work for "C likes" and others. Maybe someone has done it by now? No idea. There are some animated demos on the original home page, and maybe elsewhere: https://shaunlebron.github.io/parinfer/ I use a somewhat poor but usable Vim implementation of this. -- TXR Programming Language: http://nongnu.org/txr Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal Mastodon: @Kazinator@mstdn.ca