MESSAGE
DATE | 2016-04-26 |
FROM | Christopher League
|
SUBJECT | Re: [Hangout-NYLXS] fwiw with errors
|
From hangout-bounces-at-nylxs.com Wed Apr 27 00:07:47 2016 Return-Path: X-Original-To: archive-at-mrbrklyn.com Delivered-To: archive-at-mrbrklyn.com Received: from www.mrbrklyn.com (www.mrbrklyn.com [96.57.23.82]) by mrbrklyn.com (Postfix) with ESMTP id C3451161224; Wed, 27 Apr 2016 00:06:12 -0400 (EDT) X-Original-To: hangout-at-nylxs.com Delivered-To: hangout-at-nylxs.com Received: by mrbrklyn.com (Postfix, from userid 1000) id 72A30161914; Wed, 27 Apr 2016 00:06:02 -0400 (EDT) Resent-From: Ruben Safir Resent-Date: Wed, 27 Apr 2016 00:06:02 -0400 Resent-Message-ID: <20160427040602.GA1115-at-www.mrbrklyn.com> Resent-To: hangout-at-nylxs.com X-Original-To: ruben-at-mrbrklyn.com Delivered-To: ruben-at-mrbrklyn.com Received: from B-EXH-EDGE1.liunet.edu (b-edge1.smtp.liu.edu [148.4.248.206]) by mrbrklyn.com (Postfix) with ESMTP id B0108161224 for ; Tue, 26 Apr 2016 15:34:41 -0400 (EDT) Received: from B-EXH-3.liunet.edu (148.4.250.212) by B-EXH-EDGE1.liunet.edu (148.4.248.206) with Microsoft SMTP Server (TLS) id 14.3.210.2; Tue, 26 Apr 2016 15:34:35 -0400 Received: from localhost (96.250.202.133) by B-EXH-3.liunet.edu (148.4.250.212) with Microsoft SMTP Server (TLS) id 15.0.1156.6; Tue, 26 Apr 2016 15:34:40 -0400 From: Christopher League To: Ruben Safir In-Reply-To: <571C4DA5.8050802-at-mrbrklyn.com> References: <571C204F.10504-at-mrbrklyn.com> <87shybrdl6.fsf-at-lydrik.home.lan> <571C4DA5.8050802-at-mrbrklyn.com> User-Agent: Notmuch/0.21 (http://notmuchmail.org) Emacs/24.5.1 (x86_64-unknown-linux-gnu) Date: Tue, 26 Apr 2016 14:28:52 -0400 Message-ID: <87inz4p6l7.fsf-at-lydrik.home.lan> MIME-Version: 1.0 X-Originating-IP: [96.250.202.133] X-ClientProxiedBy: U-EXH-CAS.liunet.edu (148.4.184.26) To B-EXH-3.liunet.edu (148.4.250.212) X-Content-Filtered-By: Mailman/MimeDel 2.1.17 Subject: Re: [Hangout-NYLXS] fwiw with errors X-BeenThere: hangout-at-nylxs.com X-Mailman-Version: 2.1.17 Precedence: list Reply-To: NYLXS Discussions List List-Id: NYLXS Discussions List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============1758806834==" Errors-To: hangout-bounces-at-nylxs.com Sender: "hangout"
--===============1758806834== Content-Type: multipart/signed; boundary="===-=-="; micalg=pgp-sha256; protocol="application/pgp-signature"
--===-=-= Content-Type: multipart/alternative; boundary="==-=-="
--==-=-= Content-Type: text/plain
Ruben Safir writes:
> There should be a test to see if the symbol previously exists. If so, > then test if it is the same type as the proposed data to be assigned to > it. If so, good. If not, call the mixedtype error method.
Incidentally, I addressed exactly this issue in assignments 7 and 8. The grammar of the calc language has been augmented with a `var` keyword for the first time a variable is introduced. Then subsequent assignments don't need the `var`. That's more like in C, although the type is not specified because it's inferred from the initialization:
var x = 9 # blah blah x = 3.14; # error because x has type int
We didn't actually need it if it's purely straight-line code. Without ifs or loops, you can think of any assignment as creating a brand new variable, so it doesn't matter if it changes type.
CL
--==-=-= MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8"
Ruben Safir [1]ruben-at-mrbrklyn.com writes:
There should be a test to see if the symbol previously exists. If so, then test if it is the same type as the proposed data to be assigned to it. If so, good. If not, call the mixedtype error method.
Incidentally, I addressed exactly this issue in assignments 7 and 8. The grammar of the calc language has been augmented with a var keyword for the first time a variable is introduced. Then subsequent assignments don't need the var. That's more like in C, although the type is not specified because it's inferred from the initialization: var x = 9 # blah blah x = 3.14; # error because x has type int
We didn't actually need it if it's purely straight-line code. Without ifs or loops, you can think of any assignment as creating a brand new variable, so it doesn't matter if it changes type.
CL
References
1. mailto:ruben-at-mrbrklyn.com
--==-=-=--
--===-=-= Content-Type: application/pgp-signature; name="signature.asc"
-----BEGIN PGP SIGNATURE----- Version: GnuPG v2
iQEcBAEBCAAGBQJXH7NkAAoJEGuLsz1PMbCLzB8H/RtEn1bdbYcDKhaZlRriRVDm yT2lI0FUGWMY1BWRFwP+DnFvVCHQxQleLZND3OuzK1Nk5ZIvtX+hOAJJWaqNuueY GClx3Eq43TieZ8nCc0hesyElReXxGtltc0tEILV9+fvKCad48ghWCAcdXXESUo5Q wLbqQHprJibWuGkdT6qgw3L6lJ/Yp5Ko4h/5VGEylD5uT7jirqxo1BsKl6eNlv1I dhK3D2z19ajdOc0LP7TXpUHSzYc+W393aRQnGsLVKSSrG1AO56eLzEyO72/kQ3VM nmRyJGhOFVb0WirBSpqeSdQRnPcefZ8q6Cfu6URUE6cLILJrq/1OFWArg+S90AY= =r3zQ -----END PGP SIGNATURE----- --===-=-=--
--===============1758806834== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline
_______________________________________________ hangout mailing list hangout-at-nylxs.com http://www.nylxs.com/ --===============1758806834==--
--===============1758806834== Content-Type: multipart/signed; boundary="===-=-="; micalg=pgp-sha256; protocol="application/pgp-signature"
--===-=-= Content-Type: multipart/alternative; boundary="==-=-="
--==-=-= Content-Type: text/plain
Ruben Safir writes:
> There should be a test to see if the symbol previously exists. If so, > then test if it is the same type as the proposed data to be assigned to > it. If so, good. If not, call the mixedtype error method.
Incidentally, I addressed exactly this issue in assignments 7 and 8. The grammar of the calc language has been augmented with a `var` keyword for the first time a variable is introduced. Then subsequent assignments don't need the `var`. That's more like in C, although the type is not specified because it's inferred from the initialization:
var x = 9 # blah blah x = 3.14; # error because x has type int
We didn't actually need it if it's purely straight-line code. Without ifs or loops, you can think of any assignment as creating a brand new variable, so it doesn't matter if it changes type.
CL
--==-=-= MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8"
Ruben Safir [1]ruben-at-mrbrklyn.com writes:
There should be a test to see if the symbol previously exists. If so, then test if it is the same type as the proposed data to be assigned to it. If so, good. If not, call the mixedtype error method.
Incidentally, I addressed exactly this issue in assignments 7 and 8. The grammar of the calc language has been augmented with a var keyword for the first time a variable is introduced. Then subsequent assignments don't need the var. That's more like in C, although the type is not specified because it's inferred from the initialization: var x = 9 # blah blah x = 3.14; # error because x has type int
We didn't actually need it if it's purely straight-line code. Without ifs or loops, you can think of any assignment as creating a brand new variable, so it doesn't matter if it changes type.
CL
References
1. mailto:ruben-at-mrbrklyn.com
--==-=-=--
--===-=-= Content-Type: application/pgp-signature; name="signature.asc"
-----BEGIN PGP SIGNATURE----- Version: GnuPG v2
iQEcBAEBCAAGBQJXH7NkAAoJEGuLsz1PMbCLzB8H/RtEn1bdbYcDKhaZlRriRVDm yT2lI0FUGWMY1BWRFwP+DnFvVCHQxQleLZND3OuzK1Nk5ZIvtX+hOAJJWaqNuueY GClx3Eq43TieZ8nCc0hesyElReXxGtltc0tEILV9+fvKCad48ghWCAcdXXESUo5Q wLbqQHprJibWuGkdT6qgw3L6lJ/Yp5Ko4h/5VGEylD5uT7jirqxo1BsKl6eNlv1I dhK3D2z19ajdOc0LP7TXpUHSzYc+W393aRQnGsLVKSSrG1AO56eLzEyO72/kQ3VM nmRyJGhOFVb0WirBSpqeSdQRnPcefZ8q6Cfu6URUE6cLILJrq/1OFWArg+S90AY= =r3zQ -----END PGP SIGNATURE----- --===-=-=--
--===============1758806834== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline
_______________________________________________ hangout mailing list hangout-at-nylxs.com http://www.nylxs.com/ --===============1758806834==--
|
|