From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mike Gerwitz Newsgroups: gmane.lisp.guile.devel Subject: Re: REPL reader of multi-language Date: Fri, 30 May 2014 08:48:46 -0400 Message-ID: <20140530124846.GA1969@fencepost.gnu.org> References: <1401438340.26418.33.camel@Renee-desktop.suse> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="tThc/1wpZn/ma/RB" X-Trace: ger.gmane.org 1401454184 5669 80.91.229.3 (30 May 2014 12:49:44 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 30 May 2014 12:49:44 +0000 (UTC) Cc: guile-devel@gnu.org To: Nala Ginrut Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Fri May 30 14:49:37 2014 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WqMFc-0003TA-Kq for guile-devel@m.gmane.org; Fri, 30 May 2014 14:49:36 +0200 Original-Received: from localhost ([::1]:54067 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WqMFb-00021q-HQ for guile-devel@m.gmane.org; Fri, 30 May 2014 08:49:35 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54040) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WqMFH-000203-QF for guile-devel@gnu.org; Fri, 30 May 2014 08:49:32 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WqMEs-0002c5-4s for guile-devel@gnu.org; Fri, 30 May 2014 08:49:15 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:39672) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WqMEr-0002bv-VC for guile-devel@gnu.org; Fri, 30 May 2014 08:48:50 -0400 Original-Received: from [108.17.9.168] (port=38553 helo=fencepost.gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1WqMEr-0000vI-JS; Fri, 30 May 2014 08:48:49 -0400 Mail-Followup-To: Nala Ginrut , guile-devel@gnu.org Content-Disposition: inline In-Reply-To: <1401438340.26418.33.camel@Renee-desktop.suse> X-URL: http://mikegerwitz.com User-Agent: Mutt/1.5.21 (2010-09-15) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::e X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:17175 Archived-At: --tThc/1wpZn/ma/RB Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, May 30, 2014 at 04:25:40PM +0800, Nala Ginrut wrote: > It's not a problem for Ecmascript, because its statement has to be ended > with semicolon. So it's easier to detect the minimum compiling unit in > REPL.=20 ECMAScript uses semicolon insertion---semicolons are optional, but this can lead to ambiguities. For example: function foo() { return { foo: "bar" } } `foo` will return undefined, not {foo:"bar}, because it inserts a semi-colon after `return`; the way to get around this is to put the beginning curly brace of the object literal on the same line as `return`, in which case the expression would be completed by the closing curly brace of the object literal, semicolon optional. If you take a look at Node.js' REPL, you can see how it handles line continuations. So this problem would exist for more than just Lua. But is it actually a problem? Ctrl+D, if needed to end an expression, would represent EOF; I don't know if this is valid in Lua, but in ES, if an EOF (or semicolon) is encountered during the parsing of an expression that requires more input, then it is a syntax error---the compiler and REPL would handle it in the same way, but the REPL would just display a PS2-style prompt (which readline seems to do as "..." right in Guile 2.0). It could be my ignorance of Lua. :) --=20 Mike Gerwitz Free Software Hacker | GNU Maintainer http://mikegerwitz.com FSF Member #5804 | GPG Key ID: 0x8EE30EAB --tThc/1wpZn/ma/RB Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iQIcBAEBAgAGBQJTiH4uAAoJEPIruBWO4w6reTsQAK9TffMwtJjZyDrCY2mRxtrd yCfxmrWMVB8TPHerafaue2hYImZ3zy3a24lHDQnKiJ2oDz93TaxLJMHB+cfn8vIY +pNq/CPEBnB8/nCz/oMEjpC2+MjFycI50r9G12NrMV0uUrucNdukM7xclRrtXI58 Ao7XDl0DYcsLN8H8Z1hbJ7o4a/ZpDFfxzOvR6aDQ+T573oAGXKFpiTU4Eu3GutsN Pc70cpxdNmWgBv4ItvOc7W7XcDdAiZfe7Zhi9DMsSJPkTP8Q9nakbwXd1ktyH/8p l8xLWsAVW2lN82Mq4g1BKUmxj68yUDKWjo0fSCSnSzzs6fo77oPbpfuPt9YWu0/L DuFufeNRtFqJ7SRlJC44f02yMJqsGtQIHCSB54Hd564Qf0meOMjxpdn+8xmKpZow KSDM5Shzo3EpG1G3iPPhEZa9prHETvZNEE9ZCGrDKOpLjQo/qlu7WzL7uNbMg9Ee 0E6zrsJ8PR5oUMhq+FcLOOFNDZIlGJnlYjouQT1m1YNanpnjlCvh2e9XhWhZhO/3 UYqIkVhHxUyWrRksFn8YAkNfyqRni+rvEsf5M4qoMaCiMiTJ5he+avLMVAiu7Tmm MWabSgaYr4bxhRglZBoBU1897Y0f4N7SQ0DkDliv24cXUtzxuufU+W+m8gQSXksu JCFhrj5fw6wdqZIRIC1V =8tbE -----END PGP SIGNATURE----- --tThc/1wpZn/ma/RB--