From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id uAYHOp9IEWHEIwEAgWs5BA (envelope-from ) for ; Mon, 09 Aug 2021 17:24:15 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id QLPHNZ9IEWHqBgAAB5/wlQ (envelope-from ) for ; Mon, 09 Aug 2021 15:24:15 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 9992C3B50 for ; Mon, 9 Aug 2021 17:24:14 +0200 (CEST) Received: from localhost ([::1]:45744 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mD78P-00011Q-Lp for larch@yhetil.org; Mon, 09 Aug 2021 11:24:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38294) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mD77m-0000wm-NY for emacs-orgmode@gnu.org; Mon, 09 Aug 2021 11:23:34 -0400 Received: from relay-egress-host.us-east-2.a.mail.umich.edu ([18.216.144.57]:39620 helo=tidy-llyr.relay-egress.a.mail.umich.edu) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mD77k-0004Ng-BN for emacs-orgmode@gnu.org; Mon, 09 Aug 2021 11:23:34 -0400 Received: from secure-kasha.authn-relay.a.mail.umich.edu (ip-10-0-72-149.us-east-2.compute.internal [10.0.72.149]) by tidy-llyr.relay-egress.a.mail.umich.edu with ESMTPS id 61114871.48B09.187A77D5.308764; Mon, 09 Aug 2021 11:23:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=umich.edu; s=relay-2018-08-29; t=1628522609; bh=wb6VDGDMQ4FP6pwyNTMtIJfGUITEvRWnxiTnw7RPztY=; h=From:To:cc:Subject:In-reply-to:Date; b=FOgjQlRlDjUN1fltv9GK6F2cXapuQoVG7xlwudrFGkRGDgoams2f7VDe0qGQrOuQh ivpJCp6jrHa9JQUowqf8WpVBncknRuNOd1bxBZkEQPTvyXZngqPnp4AdRmyzgXq0Yr DGJS0tJ/Kj6QXfTNOkjJppEvcvsv9lXBPWiuYrx44QmHOK9uZ6rfrF27KHRbMtaEgu Kp4kiGP0iX/W/9lS5uO2z5TLZjJK/IK5r7XQsFMAL8phdd0FpDq+mQ+hVU6vFrk9P2 uKQcBlr4wFAjNzkKaEeOpYQ/kpCCoO83NELQBiP908j5ygn5u3dJZvzhHw6xg64wFQ gRST/hrTvfkHQ== Received: from localhost (Mismatch [78.176.116.178]) by secure-kasha.authn-relay.a.mail.umich.edu with ESMTPSA id 6111486F.DA6EC.FE7A135.3797423; Mon, 09 Aug 2021 11:23:28 -0400 From: Greg Minshall To: Zelphir Kaltstahl Subject: Re: Library of Babel usage of other programming languages than elisp In-reply-to: Your message of "Mon, 09 Aug 2021 12:52:41 +0000." X-Mailer: MH-E 8.6+git; nmh 1.7.1; GNU Emacs 27.2 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Mon, 09 Aug 2021 18:23:23 +0300 Message-ID: <547907.1628522603@apollo2.minshall.org> Received-SPF: pass client-ip=18.216.144.57; envelope-from=minshall@umich.edu; helo=tidy-llyr.relay-egress.a.mail.umich.edu 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: emacs-orgmode@gnu.org Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1628522655; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=wb6VDGDMQ4FP6pwyNTMtIJfGUITEvRWnxiTnw7RPztY=; b=Fxt05hxHHi569sBQQdl0pKbiNwKryHx1u2xwxYI1u2LEA2b94HxSNBWQ4DKUO8eLqN9JUk M6OISUs8qRFS7T1u0SglX1D39AB5SqYvMMloLgPmH0aiTdm0YHZiww5UG4ogCSIfUneN47 Uc0ja7eNrd8CoNyvDS210CfmX19nV/7CVUl4L9bc5pmxXOK+SfgpAhtrh5DdMbZCJ495fz P4nUzmqsqzTzeL4ZiPjkxFtPIMsZC6rHTHpLzXdQEjiAxBSmysYFYZE0FYAynSBMyE6h35 B/i+SzDN2WB57aGkzp/BjJfQO2hw9RRZm4085zWMiPUYhxqv4vUoAYx56ynxOQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1628522655; a=rsa-sha256; cv=none; b=VZ7alNjfcc4PpurcDtKd/nuT04b0ZNPNAptxN6zo830JpVNciP/b1G8xz6eX2zA/1cyXcM VFYUzBN7p6b1pbbH43d73KuDsPSIw0F3U49Z5bhXkSBuHe4cg/aWUopabXyGuRXRsNbYSo pc4JjddV/xMl/tBdR8NxZ27bwRt45u6NZqzyrDK51sbvRi/Zmg2Y/oC4CF5UwzTgAF4OgD XI5m2992FjnTaahoH/8w5FM3DucgGEdrZSGNSvnGHx5rs7FXaCRk0deh22NmxfOgJUR+Cm y+iltTbR+su1wl3V08kqS7V4uVQsJLRuynN+Gb+7GvAksFDrzA2nmP4ERto9/A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=umich.edu header.s=relay-2018-08-29 header.b=FOgjQlRl; dmarc=pass (policy=none) header.from=umich.edu; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -3.11 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=umich.edu header.s=relay-2018-08-29 header.b=FOgjQlRl; dmarc=pass (policy=none) header.from=umich.edu; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: 9992C3B50 X-Spam-Score: -3.11 X-Migadu-Scanner: scn0.migadu.com X-TUID: WjUrrHr7HUrC Zelphir, actually... Everybody, i have an awkwardness about not being clear of the meaning of "Library of Babel". my sense is it a collection of "subroutines". in my typical use of Org mode for programming, all my code blocks are defined in the same .org file, and executed in that file, or tangled to external files (normally, scripts). i do use <> to include bits from one part of the same file to the code in another part. i don't know if this means i am using the Library of Babel or not. then, on to... Zelphir, i also don't know what is going on. but, installing geiser, geiser-guile, and running your code from the source block, looking at the output results, i get an error that might mean something to you? see below. (notice i embedded your call to =3Dorg-lob-timediff=3D at the end of your source code.) in addition to with elisp, i use org src blocks with R, shell scripts, awk, etc. but, never (till now!) with scheme. hth. good luck. i'll be curious what your next steps are. cheers, Greg ---- #+HEADER: :var dt1=3D"uninitialized1" dt2=3D"uninitialized2" #+name: org-lob-timediff #+begin_src scheme :results output (import (ice-9 format) (srfi srfi-19)) (define org-timestamp->time-utc (=CE=BB (timestamp-string) (let ([parsed-date (string->date timestamp-string "[~Y-~m-~d ~a ~H:~M= ]")]) (date->time-utc parsed-date)))) (define duration->hours (=CE=BB (duration) ;; 1h =3D 60min =3D 3600s (/ (time-second duration) 3600))) (define org-lob-timediff (=CE=BB (org-dt1 org-dt2) ;; formatting float: ;; ~@width, decimals, scale, overflowchar, padchar ;; ~ placeholder is following ;; @ with sign if negative ;; width: minimum width ;; decimals: minimum number of digits after decimal point ;; scale: ??? ;; overflowchar: ??? ;; padchar: char to use for padding (format #f "~,2f" (number->string (exact->inexact (duration->hours (time-difference (org-timestamp->time-utc org-dt2) (org-timestamp->time-utc org-dt1)))))))) (org-lob-timediff "[2021-01-01 Fri 00:00]" "[2021-01-01 Fri 01:45]") #+end_src #+RESULTS: org-lob-timediff : ice-9/boot-9.scm:222:17: In procedure map1: : Syntax error: : unknown file:12:0: definition in expression context, where definitions ar= e not allowed, in form (define org-timestamp->time-utc (=CE=BB (timestamp-s= tring) (let ((parsed-date (string->date timestamp-string "[~Y-~m-~d ~a ~H:~= M]"))) (date->time-utc parsed-date)))) :=20 : Entering a new prompt. Type `,bt' for a backtrace or `,q' to continue. : scheme@(guile-user) [1]>=20