From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Arthur Miller Newsgroups: gmane.emacs.help Subject: Re: Lisp anime video Date: Sun, 05 Sep 2021 21:55:52 +0200 Message-ID: References: <20210829074031.GB18750@tuxteam.de> <871r6c8ybx.fsf@zoho.eu> <87v93oy0ny.fsf@posteo.net> <86lf4ck43a.fsf@protonmail.com> <87lf4czc8e.fsf@zoho.eu> <867dfwe5n1.fsf@protonmail.com> <87h7f0x85k.fsf@zoho.eu> <878s0byj4d.fsf@zoho.eu> <20210905072929.GB4268@tuxteam.de> <87a6krm66r.fsf@zoho.eu> <20210905150506.GB19479@tuxteam.de> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5305"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: help-gnu-emacs@gnu.org To: Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sun Sep 05 21:57:21 2021 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 1mMyGW-0001CY-LO for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 05 Sep 2021 21:57:20 +0200 Original-Received: from localhost ([::1]:56950 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mMyGU-0004bY-Pr for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 05 Sep 2021 15:57:18 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37978) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMyFH-0004aO-F3 for help-gnu-emacs@gnu.org; Sun, 05 Sep 2021 15:56:12 -0400 Original-Received: from mail-am6eur05olkn2049.outbound.protection.outlook.com ([40.92.91.49]:9664 helo=EUR05-AM6-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMyFE-0007U9-3e for help-gnu-emacs@gnu.org; Sun, 05 Sep 2021 15:56:02 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OSh6SeAqIY7zEx3E28RoTLIhNJTHVLZkOj53bqnyTZ6P1J61U/kRnRiM8KJ0/50jq1HEOccWI0V9wzluZt0PL4BgqPMdozxuOjF5qsUGeoNOzN+vqgQbj3pgW8x0eohqYHGvPeJd9o9ngxl7f09yXhqQU2h2J7pMi6euXDqc60a4jUq4FyBpOQ2PVLugqLCCJ/m7wjUyR5uji8G0uJOIzzLIF/rVJGDqqMZxzXtKHxNltaJqjnQ1kUMGVMEoxPWasS3DjztR3l7iDTlM3usxYLSvkRTH07OJa4/u5QFo3Ov0orqDUvpRBKV8BWLUkh2Vl6Rd3jkDW65FT5OSWD+dtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=ubvndsiAw9tQ+B4JXYzQWZKE6H3jySwtKBmJO0BsN14=; b=Ae52QYWt8HrD8c9Gt0STDJ1rL3iJsBZTG1w3gPWq3PaJSnRwfkY0WpmvLbDjPyJcsvNK/UozFylxiK8MR0ihQz/hi3ZnRlBHfQ/H256qLOXmZMP1awr06XQiytGD1mobC33bu+BCdx5lp9XGwActAQTbyk05xM/5b7KsT2b9rLsH4sCPCnvrJEVWb72gfKULqt9GOrbQ6ega39A8dvBPT+TKwf8IKP13la9Nc1k7Ow221ij2ehA0skKe8rpmDOoMejaxhu1isl/qMeA2oISM8lvD4E+h11kXP57movJhwSQOORLOzrYr5oVZpB3X4Zs4pGnOiXblAs/n3Go1PJm2Zg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=live.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ubvndsiAw9tQ+B4JXYzQWZKE6H3jySwtKBmJO0BsN14=; b=hkJ+wCPRS3IYTcKFPB4BCfGnXwz/rXoW4Zqs/1D4UnPFPajzFAx4+iBqcwUIUWpc/K+/t3wHAYwUaf6AYKfCs+RRehPdY8+kby4QpGqm0ktLY5aAMflH1xzyLJIC6t+BsH343HJKI5bc0Jbmf4ucYHHIy4FG8ph/tjDk+tg5e0D83Pzpyi9xnlrSR9pZ2C7daEhhbUZsalLL12zGJ3jTCD1BMabfLunub8pG/0xkjoqGKug6CiZ8ehwOaiIP+bKYB6TrbreZ5BLpBVraK+/Ljkiq714PEugQWQNZXv0K0mSaO+DOqk5CfQh5e2JO+TNW/0khtZi9GUmHE6eNCuWVXQ== Original-Received: from AM9PR09MB4977.eurprd09.prod.outlook.com (2603:10a6:20b:304::20) by AM0PR09MB2385.eurprd09.prod.outlook.com (2603:10a6:208:dc::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4478.22; Sun, 5 Sep 2021 19:55:52 +0000 Original-Received: from AM9PR09MB4977.eurprd09.prod.outlook.com ([fe80::c55c:ece5:bed2:a9dc]) by AM9PR09MB4977.eurprd09.prod.outlook.com ([fe80::c55c:ece5:bed2:a9dc%8]) with mapi id 15.20.4478.025; Sun, 5 Sep 2021 19:55:52 +0000 In-Reply-To: <20210905150506.GB19479@tuxteam.de> (tomas@tuxteam.de's message of "Sun, 5 Sep 2021 17:05:06 +0200") X-TMN: [rVGrjPqWWQYYfbZOX7W49qka4foQxJDl] X-ClientProxiedBy: AM6P195CA0090.EURP195.PROD.OUTLOOK.COM (2603:10a6:209:86::31) To AM9PR09MB4977.eurprd09.prod.outlook.com (2603:10a6:20b:304::20) X-Microsoft-Original-Message-ID: <871r623ign.fsf@live.com> X-MS-Exchange-MessageSentRepresentingType: 1 Original-Received: from pascal.homepc (81.232.177.30) by AM6P195CA0090.EURP195.PROD.OUTLOOK.COM (2603:10a6:209:86::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4478.17 via Frontend Transport; Sun, 5 Sep 2021 19:55:52 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8ff16592-6489-46d6-d6c6-08d970a72a80 X-MS-TrafficTypeDiagnostic: AM0PR09MB2385: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4DjFPHqGQyYP5X6ff4+hOMrxe+0HwpqaL5gr6jgsahGAyVh7m6KnnvaBKv/vIC9jVQbnLFJ3OvqrlC1zihenvUQPP5zSXV6QWkKqHnCzzivu9eKvJMovX/JHkqbQ7xDK8WMD2K19jaIhu0PwwQUS4fzZPq1W/ROgYRT7ge6SAj1pSncJuWWnGL76mObz2HI3+gXI13UsRJtDf5Vj3bmudB0esiKCd+M8oKUDunZYAFdpiL5qZ65LlF3/lTRSLTjjoqxVS5fvvmpGmJgKMmHI7mvKgFRYcMTajjvt1vvrjHjfJMQKXwAC5sLK8b6hhk1KR6BUKga9odexLiq36CrwNqsYWnV9RpTPxZHeQ4VJyR2QsOleBZdTzvcl4CpqvKVxTeAlIL/JXyMdFyG75dLGr8o2PMHowHybGDdxjDJC++W4egQaxjk6moaXu64wkk9K X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Op17+fQbtSuIGPGl/G5oDvPxH+QvTcVCX5eZEImnXfiAwh98cw8glrXGu/px62ZDqpg+aS9plnBMbQ6Dqx2pqOuiSGhdOIdfbC+R+Ofj2dgvlqQ79oMLuJuVOiCta2gsBaSNQsQcXC8hvggWkwC9Kw== X-OriginatorOrg: sct-15-20-3174-20-msonline-outlook-72e6e.templateTenant X-MS-Exchange-CrossTenant-Network-Message-Id: 8ff16592-6489-46d6-d6c6-08d970a72a80 X-MS-Exchange-CrossTenant-AuthSource: AM9PR09MB4977.eurprd09.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Sep 2021 19:55:52.8036 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR09MB2385 Received-SPF: pass client-ip=40.92.91.49; envelope-from=arthur.miller@live.com; helo=EUR05-AM6-obe.outbound.protection.outlook.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 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" Xref: news.gmane.io gmane.emacs.help:132910 Archived-At: --=-=-= Content-Type: text/plain writes: > On Sun, Sep 05, 2021 at 04:46:04PM +0200, Emanuel Berg via Users list for the GNU Emacs text editor wrote: > > [...] >> Yeah, head and tail I get, that is more related to the list > > [...] > >> And not that people were handling huge and complicated nested >> data structures? Which sounds very impractical and error prone? >> Only they were so skilled it still worked? With `car', `cdr', >> and, literally, 28 combinations? > > Never forget that a list's car can also be... a list. That's the > fun part :-) Indeed lists can be fun. I think it is fun that there is no explicit data structure called list in traditional lisps, it just a way to work with conses. By the way, I found a nice little program to show cons structures (lists) and converted it to elisp. It is cool, looks like box drawings in early papers. cheers - "always angry" --=-=-= Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename=draw-cons-tree.el Content-Transfer-Encoding: quoted-printable ;;; draw-cons-tree.el Draw ascii image of a cons tree. -*- lexical-binding= : t; -*- ;; Ported from scheme to common lisp ;; http://www.t3x.org/s9fes/draw-tree.scm.html ;; It was in the public domain before so it will stay that way now. ;; Ported from common lisp to emacs lisp from ;; https://github.com/cbaggers/draw-cons-tree ;; Version: 1.0 (require 'cl-lib) ;;; Customize (defgroup draw-cons-tree nil "Visualize lists as cons boxes." :tag "Draw cons tree" :prefix "draw-cons-tree-" :group 'tools) (defcustom draw-cons-tree-prettify nil "Use box-drawing unicode characters for horizontal and vertical bars." :type 'boolean :group 'draw-cons-tree) ;;; Entry function (defun draw-cons-tree (n) (cl-labels ((%draw-tree (n) (unless (draw-cons-tree--donep n) (insert "\n") (draw-cons-tree--draw-bars n) (insert "\n") (%draw-tree (draw-cons-tree--draw-members n))))) (if (not (consp n)) (draw-cons-tree--draw-atom n) (%draw-tree (draw-cons-tree--mark-visited (draw-cons-tree--draw-conses n)))) (insert "\n"))) =0C ;;; Internal functions ;;;; Helpers (defconst draw-cons-tree--nothing (cons 'N nil)) (defconst draw-cons-tree--visited (cons 'V nil)) (defun draw-cons-tree--mark-visited (x) (cons draw-cons-tree--visited x)) (defun draw-cons-tree--members-of-x (x) (cdr x)) (defun draw-cons-tree--emptyp (x) (equal x draw-cons-tree--nothing)) (defun draw-cons-tree--visitedp (x) (equal (car x) draw-cons-tree--visited)) (defun draw-cons-tree--donep (x)=20 (and (consp x) (draw-cons-tree--visitedp x) (null (cdr x)))) (defun draw-cons-tree--all-verticalp (n) (or (not (consp n)) (and (null (cdr n)) (draw-cons-tree--all-verticalp (car n))))) (defun draw-cons-tree--skip-empty (n) (if (and (consp n) (or (draw-cons-tree--emptyp (car n)) (draw-cons-tree--donep (car n)))) (draw-cons-tree--skip-empty (cdr n)) n)) (defun draw-cons-tree--remove-trailing-nothing (n) (reverse (draw-cons-tree--skip-empty (reverse n)))) =0C ;;;; Drawing (defun draw-cons-tree--draw-fixed-string (s) (let* ((b (make-string 8 ?\s)) (k (length s)) (s (if (> k 7) (cl-subseq s 0 7) s)) (s (if (< k 3 ) (cl-concatenate 'string " " s) s)) (k (length s))) (insert (cl-concatenate 'string s (cl-subseq b 0 (- 8 k)))))) (defun draw-cons-tree--draw-atom (n) (draw-cons-tree--draw-fixed-string (format "%s" n))) (defun draw-cons-tree--draw-conses (n &optional r) (cond ((not (consp n)) (draw-cons-tree--draw-atom n) (setq r (nreverse r))) ((null (cdr n)) (insert "[o|/]") (setq r (nreverse (cons (car n) r)))) (t (insert (if draw-cons-tree-prettify "[o|o]=E2=94=80=E2=94=80=E2=94=80" "[= o|o]---")) (draw-cons-tree--draw-conses (cdr n) (cons (car n) r))))) (defun draw-cons-tree--draw-bars (n) (cl-labels ((%draw-bars (n) (cond ((not (consp n))) ((draw-cons-tree--emptyp (car n)) (draw-cons-tree--draw-fixed-string "") (%draw-bars (cdr n)) ) ((and (consp (car n)) (draw-cons-tree--visitedp (c= ar n))) (%draw-bars (draw-cons-tree--members-of-x (car n)= )) (%draw-bars (cdr n))) (t (draw-cons-tree--draw-fixed-string (if draw-cons-tree-prettify "=E2=94=82" "|")) (%draw-bars (cdr n)))))) (%draw-bars (draw-cons-tree--members-of-x n)))) (defun draw-cons-tree--draw-members (n) (cl-labels ((%draw-members (n r) (cond ((not (consp n)) (draw-cons-tree--mark-visited (draw-cons-tree--remove-trailing-nothing (setq r (nreverse r))))) ((draw-cons-tree--emptyp (car n)) (draw-cons-tree--draw-fixed-string "") (%draw-members (cdr n) (cons draw-cons-tree--n= othing r))) ((not (consp (car n))) (draw-cons-tree--draw-atom (car n)) (%draw-members (cdr n) (cons draw-cons-tree--n= othing r))) ((null (cdr n)) (%draw-members (cdr n) (cons (draw-cons-tree--draw-final (car n)) r)= )) ((draw-cons-tree--all-verticalp (car n)) (draw-cons-tree--draw-fixed-string "[o|/]") (%draw-members (cdr n) (cons (caar n) r))) (t (draw-cons-tree--draw-fixed-string (if draw-cons-tree-prettify "=E2=94=82" "|"= )) (%draw-members (cdr n) (cons (car n) r)))))) (%draw-members (draw-cons-tree--members-of-x n) nil))) (defun draw-cons-tree--draw-final (n) (cond ((not (consp n)) (draw-cons-tree--draw-atom n) draw-cons-tree--nothing) ((draw-cons-tree--visitedp n) (draw-cons-tree--draw-members n)) (t (draw-cons-tree--mark-visited (draw-cons-tree--draw-conses n))))) (provide 'draw-cons-tree) ;;; draw-cons-tree.el end here --=-=-=--