From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Emanuel Berg Newsgroups: gmane.emacs.help Subject: Re: Surprising behaviour of 'append' with string Date: Sun, 06 Nov 2022 19:41:10 +0100 Message-ID: <87y1soaptl.fsf@dataswamp.org> References: <17b9a480-cff1-212e-7d8a-894285d03646.ref@yahoo.de> <17b9a480-cff1-212e-7d8a-894285d03646@yahoo.de> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37889"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) To: help-gnu-emacs@gnu.org Cancel-Lock: sha1:27ta2S6fKkDd4YZqK/58/HgPSbQ= Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Mon Nov 07 13:42:07 2022 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1os1S3-0009dj-E1 for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 07 Nov 2022 13:42:07 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1os1RQ-0000a1-ED; Mon, 07 Nov 2022 07:41:28 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1orkaH-00014u-2j for help-gnu-emacs@gnu.org; Sun, 06 Nov 2022 13:41:29 -0500 Original-Received: from ciao.gmane.io ([116.202.254.214]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1orkaB-000280-IS for help-gnu-emacs@gnu.org; Sun, 06 Nov 2022 13:41:28 -0500 Original-Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1orka7-0008PL-AN for help-gnu-emacs@gnu.org; Sun, 06 Nov 2022 19:41:19 +0100 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: help-gnu-emacs@gnu.org Mail-Copies-To: never Received-SPF: pass client-ip=116.202.254.214; envelope-from=geh-help-gnu-emacs@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.249, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Mon, 07 Nov 2022 07:41:20 -0500 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:140772 Archived-At: R Diez wrote: > Don't you think that 'append' and its documentation are not > really user friendly? Its behaviour is not what you would > normally expect. It doesn't make sense to join list elements > with the first characters of strings. Well, to the person who wrote it it did, but I don't know what use case he had in mind. > At least some example and/or warning about it would prevent > unwary users Sure, you can use `report-emacs-bug' for this. > from wasting time and feeding the general sentiment that > Emacs and Lisp are not user friendly. Emacs and Lisp are maximalist systems that grow from everywhere, at the same time, and always, such systems can be perceived as chaotic to people who are not used to that approach, which actually isn't that unusual, but such systems are also more interesting and ultimately more powerful. Also that power, in the sense there are several ways to do things and everything is configurable thru the same interface (Elisp and now to some extent C, with dynamic modules, even), all that maybe doesn't feel user friendly but at the end of the day it's a true pal. >> Isn't it better to use a shell script language then? > > Whether shell is better than Lisp is debatable. But say I want > to write the logic in shell. Then I would need to pass the > information (flags and config settings) down from Emacs (where > they live now), in form of command-line arguments, and that's > the kind of routine I am looking for in order to help me do > that, isn't it? Shell script languages and Lisp are not really comparable, script languages are useful for user-interaction when the user uses the shell, also when a lot of shell tools and/or other scripts are involved. Lisp OTOH is a general-purpose programming language. So while you can ask a script for some data from a Lisp program, to use Lisp to put together shell commands to be executed - that will only complicate things for no gain in sight, it's not optimized for that, and why would it be? The shell script languages are, or should be, or it's better than doing it in Lisp anyway. Note that there are Lisp shell languages as well! Lish (Lisp as a shell) [1] - Lush (Lisp Universal Shell) [2] and many other. However if you use Emacs you already have Lisp (Emacs Lisp or Elisp) so I'd actually recommend doing the shell in some POSIX-style extended shell, e.g. bash, ksh or zsh ... [1] https://www.cliki.net/Lisp%20as%20a%20shell [2] https://lush.sourceforge.net/ -- underground experts united https://dataswamp.org/~incal