[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

*To*: Andrew Robbins <andjrob@x>*Subject*: Re: [Scheme-reports] Proposal for New Complex Number Syntax*From*: quad <quad@x>*Date*: Mon, 26 Mar 2012 10:15:43 -0600*Cc*: scheme-reports@x*In-reply-to*: <CAAMbixKytwB84FBHACz2oreaL8p5Zz-SoNSdK0MpVXUmvPMQ+Q@mail.gmail.com>*References*: <CAPbE8xAgpyXhBkCwByHnZV6U3gERW4JRQS5nOrOK82-Zdgp4cA@mail.gmail.com> <CAAMbixKytwB84FBHACz2oreaL8p5Zz-SoNSdK0MpVXUmvPMQ+Q@mail.gmail.com>

On Mon, Mar 26, 2012 at 8:29 AM, Andrew Robbins <andjrob@x> wrote: > Why stop there? Why remove only complex notation, when you can get rid > of nasty rational notation too! Good question. If I had my way, I would remove the rational notation too, but I'll keep one target on lock at a time. Firstly, complex number notation is much more sophisticated than rational number notation. Just look at the rules for each. Secondly, the "+" in the complex number notation is supposed to emulate the mathematical notation "a+bi". Having taught Scheme, some students wonder why they can't do "5i+3". "+" is of course a commutative operation, and so this kind of confusion arises. The same doesn't happen with "/". Some also wonder why "4+3" doesn't work, especially since it's a valid identifier. Lastly, there's a good reason to have this #c(a b) syntax that is a little deeper than a convenient lexical change. Consider constructing a macro which will generate code for a fixed-length power-of-2 FFT. When computing an FFT of size N, you're going to need the primitive N-th roots of unity. For less math savvy people, you're going to need *constant* complex numbers which apply in the algorithm. Now, obviously, you can use MAKE-COMPLEX, but this does not give any guarantee that the constants are going to be folded. In fact, if you're generating code in a LAMBDA, then there is a much less chance of this happening, since LAMBDA is a way to delay computations. It would be much easier if the notation for complex numbers (and therefore rationals) welcomed easy construction of literals. -Robert Smith _______________________________________________ Scheme-reports mailing list Scheme-reports@x http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports

**References**:**[Scheme-reports] Proposal for New Complex Number Syntax***From:*quad <quad@x>

**Re: [Scheme-reports] Proposal for New Complex Number Syntax***From:*Andrew Robbins <andjrob@x>

- Prev by Date:
**Re: [Scheme-reports] Proposal for New Complex Number Syntax** - Next by Date:
**Re: [Scheme-reports] Proposal for New Complex Number Syntax** - Previous by thread:
**Re: [Scheme-reports] Proposal for New Complex Number Syntax** - Next by thread:
**[Scheme-reports] Ref cells** - Index(es):