From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Christian Johansson Newsgroups: gmane.emacs.devel Subject: Re: I want to add a package to GNU ELPA: infix-notation-calculator Date: Wed, 18 Aug 2021 11:03:27 +0200 Message-ID: <973b0019-0de2-154a-2088-d2367cb32bab@cvj.se> References: <90e77688-8912-2002-7fe8-86c5e58fb42d@cvj.se> <90971c32-68c7-f59e-c426-ef0ecc5af0d0@cvj.se> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7364"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 Cc: emacs-devel@gnu.org To: Stefan Monnier , Eric S Fraga Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Aug 18 11:04:58 2021 Return-path: Envelope-to: ged-emacs-devel@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 1mGHVJ-0001aG-3o for ged-emacs-devel@m.gmane-mx.org; Wed, 18 Aug 2021 11:04:57 +0200 Original-Received: from localhost ([::1]:35872 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mGHVH-0003j3-9l for ged-emacs-devel@m.gmane-mx.org; Wed, 18 Aug 2021 05:04:55 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53114) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mGHU2-0002gB-E6 for emacs-devel@gnu.org; Wed, 18 Aug 2021 05:03:38 -0400 Original-Received: from mailrelay3-3.pub.mailoutpod1-cph3.one.com ([46.30.212.12]:15518) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mGHTz-0006c9-Pw for emacs-devel@gnu.org; Wed, 18 Aug 2021 05:03:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cvj.se; s=20191106; h=content-transfer-encoding:content-type:in-reply-to:mime-version:date: message-id:from:references:cc:to:subject:from; bh=M145miiTzozvC5WM9d4WMqsnOyBW3haunE2QojNNf6M=; b=fBIG3B7NuUQjWZPmD9tDSJAIOavDjV6vqkprJZ7bj09MblgNRrKXst8MBE7kYfFkP7f7ba7pxQ9gp c6y0qlooDAru1vpD73DDr0FGck2YvFkvdP2UBJggaLVw7lLR+8WgmIaJ4pBpuU+5dQv2PxwU2Eet7r AXcP1tk9MDXLuh6OZ/EmQrLXV0Kz4V/kYgRfuFcAUZyEi/VdmxbTi0+38GCj7nK9R/HtrnG6nOxSzA M61zYwS5EjlbuKay5svo/WkeGqBVu/z8WMFFOUJdTr44WBIsIUF5e/RvpkwJYJugztGzgIRXAM6eTm CZKTlunnIWjFaamG8tlT2tfscCkOIMg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cvj.se; s=rsa1; h=content-transfer-encoding:content-type:in-reply-to:mime-version:date: message-id:from:references:cc:to:subject:from; bh=M145miiTzozvC5WM9d4WMqsnOyBW3haunE2QojNNf6M=; b=XjrlQKNnYSoqk6n8kI/0iQORAMiQyL+y9hHlvJPAX9g9936/WpPIUiJ4kNTm8LkkQNR8YOPDAIMeD xelVLvSxXpPCW5Y1B6OXIVmTUvn21vz6oLnboXOV6qnaY3ZH9YcxS+Phjx1mYmFRsjLYPMmzBIkznF rktaIC1Zb/cx3FZkkO9qMANVPXiI3EtuxO6FNG4T/pZgy5Hrpma0JUPNORzF83YzkFjxp3ee7K+CB1 +qZS3klZ55SW5+BO+K+a3/k+a+Tq6E8cmT+VFez5RICMlgRAloNwWkBjNGIz2fPvrjWuc31zyikIRP dhivjxJPf0fLRb1ErGAwflNz0VcRk/A== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=cvj.se; s=ed1; h=content-transfer-encoding:content-type:in-reply-to:mime-version:date: message-id:from:references:cc:to:subject:from; bh=M145miiTzozvC5WM9d4WMqsnOyBW3haunE2QojNNf6M=; b=n7xLyY/vZnTWwBaTMrkUMao388yoIdVXCKxx5r+aWL7Xo63A5/5CZ/RR3mau1Bvxz6U/JCkHoh/Xn CD3NEk7AQ== X-HalOne-Cookie: ad06780ecdababa464ca5037c69ce9163ea446bc X-HalOne-ID: 26baa3cf-0003-11ec-879b-d0431ea8bb03 Original-Received: from [192.168.50.160] (c188-150-212-230.bredband.tele2.se [188.150.212.230]) by mailrelay3.pub.mailoutpod1-cph3.one.com (Halon) with ESMTPSA id 26baa3cf-0003-11ec-879b-d0431ea8bb03; Wed, 18 Aug 2021 09:03:28 +0000 (UTC) In-Reply-To: Content-Language: en-US Received-SPF: none client-ip=46.30.212.12; envelope-from=christian@cvj.se; helo=mailrelay3-3.pub.mailoutpod1-cph3.one.com X-Spam_score_int: -40 X-Spam_score: -4.1 X-Spam_bar: ---- X-Spam_report: (-4.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, NICE_REPLY_A=-1.961, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:272552 Archived-At: Eric: calc-embedded is really good, even better than my plugin, thanks for the tip! Storing calculations in variables is a good feature Stefan: Looks cool, didn't it's possible to do stuff like that, however this project was primarily about testing my parser generator so I wouldn't want to change those parts of the program Hälsningar / Best Regards Christian On 18/08/2021 01:28, Stefan Monnier wrote: >> Sure, I think calc and calculator are more full-focused calculators that >> require a learning-curve, this plugin is more of an quick ad-hoc calculator >> that calculates values like (infix notation) > [...] > > Thanks, but I meant to add that to the README or the `Commentary:`. > > Also I was thinking more about the documentation on which operations are > supported. [ IIUC you only support the four basic arithmetic > operations, with standard precedence rules, plus parentheses for > grouping, right? ] > > Also, I was wondering if you had considered implementing the parser with > the following approach: > > - read the line with (read-from-string (concat "(" STRING ")")) > - massage the resulting sexp to implement the desired infix syntax. > > You could even do the massaging via a macro, where > > (infix 2 + 3 * 5) > (infix 2 + (3 * 5)) > (infix (2 + ((3) * 5))) > > all macroexpand to > > (+ 2 (* 3 5)) > > so your syntax could be used inside code as well. > > > Stefan >