From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id sH6YOF/vJ2NPrQAAbAwnHQ (envelope-from ) for ; Mon, 19 Sep 2022 06:26:07 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id mKumOF/vJ2OLNAEA9RJhRA (envelope-from ) for ; Mon, 19 Sep 2022 06:26:07 +0200 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 5814F39514 for ; Mon, 19 Sep 2022 06:26:07 +0200 (CEST) Received: from localhost ([::1]:43360 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oa8M9-0004f8-I5 for larch@yhetil.org; Mon, 19 Sep 2022 00:26:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33532) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oa8Li-0004ek-Nq for emacs-orgmode@gnu.org; Mon, 19 Sep 2022 00:25:38 -0400 Received: from [39.171.215.24] (port=5934 helo=Mac-mini.local) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oa8Lg-0006Ht-MA for emacs-orgmode@gnu.org; Mon, 19 Sep 2022 00:25:38 -0400 Received: by Mac-mini.local (Postfix, from userid 501) id DF5DE64BB54E; Mon, 19 Sep 2022 12:25:27 +0800 (CST) References: User-agent: mu4e 1.8.9; emacs 29.0.50 From: "Christopher M. Miles" To: Org Mode Cc: Bastien Guerry Subject: Re: [PATCH] Fix ob-clojure handling source block variable's value is a org-mode table or list Date: Mon, 19 Sep 2022 12:23:52 +0800 In-reply-to: Message-ID: MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-Host-Lookup-Failed: Reverse DNS lookup failed for 39.171.215.24 (deferred) Received-SPF: softfail client-ip=39.171.215.24; envelope-from=numbchild@gmail.com; helo=Mac-mini.local X-Spam_score_int: 58 X-Spam_score: 5.8 X-Spam_bar: +++++ X-Spam_report: (5.8 / 5.0 requ) BAYES_00=-1.9, DKIM_ADSP_CUSTOM_MED=0.001, FORGED_GMAIL_RCVD=1, FREEMAIL_FROM=0.001, MSGID_MULTIPLE_AT=1, NML_ADSP_CUSTOM_MED=0.9, RCVD_IN_PBL=3.335, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_SOFTFAIL=0.665, SPOOFED_FREEMAIL_NO_RDNS=0.001 autolearn=no autolearn_force=no X-Spam_action: reject X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: numbchild@gmail.com Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1663561567; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=GCEwAuIuPzlXItTSFLMohRSMj3DQMQZswmGp2b/2pYk=; b=EPBe0P5k+A7bKkpHPPv5J5YhJXWR5tY6nmPz0Yb2PykUGQA5y5QhDObBB59MH0YKn1gSP0 7jg3nMY4ECS4nTWhvP8NIhOrVyq1nPHkmKUl3YcoYqgj/ltzw8A6Zbc3KOR1B6y9bLfads YpixVkn3+DFl2OUEE2330r9FbEiWbz6yr9YEkicBPNFk60YqVZ687FyL0a9eynj5q+zZYr 6u0eGigyzj1XQtnRCdo2ohtodyq8P8fNiddu/VhuNofMo3ZkJoDFF5PDT9FK8odJMMeMM7 G+fZx+cufVlNtSLn1UIx5kXYHGLVJrSNt0kY4v+DhJMKTW0wBdbb00IT0+I3TQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1663561567; a=rsa-sha256; cv=none; b=caJcKGpO2PT1Owt48FGVkb9fQ4RbEiY1gNczo/9WfS1eGlPdcnbz1YJpT3dbyQIVcNXbJo JLOmLIBDxEC5/OUvi0McDiSzqkj3YXlukhC6laXrCwGPz9C4HnUiwaCM/3KsW/yZyZ6KdE hie1MYqWnZ2rG8vF1Tcp9Ur9rtBm5mh1Io/QF3lqfW7BXx8r/P+lE2VIroCtwRUstPxL6Q d39fQeuCC+LlNzMzupbn0QlX9OJ3y69NT1WlE6lzfAONuMJP/s+K0CZOPMDJoq+fO/QYPi ntLdRqu76sjFpXi1D7ZyglMHzSQyaH6/lTWhvSCYYfJujbcHRsaQcQlWN4sd3w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: 1.76 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 5814F39514 X-Spam-Score: 1.76 X-Migadu-Scanner: scn1.migadu.com X-TUID: SKpOblVwaYL5 --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Ping Bastien Guerry. "Christopher M. Miles" writes: > [[PGP Signed Part:Undecided]] > > I bellowing example: > > #+begin_src org > ,#+NAME: ob-clojure-table-test > | a | b | c | > |---+---+---| > | 1 | 2 | 3 | > > ,#+NAME: ob-clojure-table-test-2 > | a | b | c | > |---+---+---| > | 1 | 2 | 3 | > > ,#+begin_src clojure :var kk=3Dob-clojure-table-test :var kk2=3Dob-clojur= e-table-test-2 :results output > (println kk2) > (println kk) > ,#+end_src > > #+end_src > > Without this patch, it will report error "class java.lang.ClassCastExcept= ion" from CIDER. > > This patch added if condition to handle this table, list type data. > > From 948e8c1ff2c9ba1d9c0fe26f9bdaa096bef80a9d Mon Sep 17 00:00:00 2001 > From: stardiviner > Date: Sat, 9 Apr 2022 21:14:22 +0800 > Subject: [PATCH] ob-clojure.el: Fix header argument :var binding passed t= able > or list data > > * lisp/ob-clojure.el (org-babel-expand-body:clojure): Add if condition > to handle source block :var passed org-mode table or list data for > clojure let-binding to avoid java.lang.ClassCastException. > --- > lisp/ob-clojure.el | 25 ++++++++++++++++++------- > 1 file changed, 18 insertions(+), 7 deletions(-) > > diff --git a/lisp/ob-clojure.el b/lisp/ob-clojure.el > index 5a44b6487..e6614b2d9 100644 > --- a/lisp/ob-clojure.el > +++ b/lisp/ob-clojure.el > @@ -101,13 +101,24 @@ > (and (cdr (assq :ns params)) (format "(ns %s)\n" ns)) > ;; Variables binding. > (if (null vars) (org-trim body) > - (format "(let [%s]\n%s)" > - (mapconcat > - (lambda (var) > - (format "%S %S" (car var) (cdr var))) > - vars > - "\n ") > - body)))))) > + ;; variable's value is a list from org-mode passed ta= ble or list. > + (if (listp (cdr (car vars))) > + (format "(let [%s]\n%s)" > + (mapconcat > + (lambda (var) > + (format "%S '%S" (car var) (cadr var))) > + vars > + "\n ") > + body) > + ;; else, the header argument variable's value is no= t a list. > + (format "(let [%s]\n%s)" > + (mapconcat > + (lambda (var) > + (format "%S %S" (car var) (cdr var))) > + vars > + "\n ") > + body) > + )))))) > (if (or (member "code" result-params) > (member "pp" result-params)) > (format "(clojure.pprint/pprint (do %s))" body) > --=20 > 2.35.1 > > [5. text/x-patch; 0001-ob-clojure.el-Fix-header-argument-var-binding-pass= ed.patch]... =2D-=20 [ stardiviner ] I try to make every word tell the meaning that I want to express without mi= sunderstanding. Blog: https://stardiviner.github.io/ IRC(libera.chat, freenode): stardiviner, Matrix: stardiviner GPG: F09F650D7D674819892591401B5DF1C95AE89AC3 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAmMn7zQACgkQG13xyVro msPL/AgAkUasStgMoTb/AYEP3xjH+0kGdp5hBiR4Prp3eQDs5+OM2sLmanr0dFqd BiceiudSTwH4AnK+YJVdrutopJBqqTMQqpPV2DALQPLyglCCsNJafghMm3UlCGsU EY62yYgjhpyT/LHRI0ibZxukhnuaY7P0ny9BW4iHgubBpnCKjoDoOxV2A+UE2kqR ux2emEK6Ym7uIvL9ta2rEutpUwOUHnPzf9RjIYfXb0ApiWQoskUzWCfgMhDWE0uX PhLr/OHNzgogG4g3z7Z4waH1E3imqRQ9hFnAALOV/UbleBBoAJo0bZEbtuoAD7Us cFwmOgTYyyioL1i2deu5SXnJgSWDqA== =9ryj -----END PGP SIGNATURE----- --=-=-=--