Newsgroups: comp.lang.apl Path: utzoo!utgpu!news-server.csri.toronto.edu!torsqnt!tmsoft!itcyyz!yrloc!rbe From: rbe@yrloc.ipsa.reuter.COM (Robert Bernecky) Subject: Re: Do I really need a loop? Message-ID: <1991May17.215809.27935@yrloc.ipsa.reuter.COM> Reply-To: rbe@yrloc.ipsa.reuter.COM (Robert Bernecky) Organization: Snake Island Research Inc, Toronto References: <3970004@hpwrce.HP.COM> <15160018@hpdmd48.boi.hp.com> <1991May15.134305.10894@yrloc.ipsa.reuter.COM> <1991May17.031707.27992@cshl.org> Date: Fri, 17 May 91 21:58:09 GMT In article <1991May17.031707.27992@cshl.org> monardo@cshl.org (Pat Monardo) writes: >In article <1991May15.134305.10894@yrloc.ipsa.reuter.COM> hui@yrloc.ipsa.reuter.COM (Roger Hui) writes: >> >>Alternatively, in J, one could write M *"1 0 V . The rank conjunction >>(") modifies times (*) to work on rank 1 objects on the left and rank 0 >>objects on the right; that is, multiply vectors of M by scalars of V. >> >>Alternatively, one could write M *"_1 V ; that is, multiply items of M >>by items of V. > >amen. and the absurdity of the previous posts should make them >reconsider whether the APL they speak has any value at all. Perhaps we should be a bit gentler, and just suggest that those APL dialects of yore have failed to adopt general principles of extension, and have added special cases for many primitives instead, following the lead of the Fortran 90 designers... I think the key to J and rank is that the SAME expression works for ANY verb, whether primitive or user-defined. This is what sets it apart from APL2 and other such dialects of APL. This makes the language easier to learn and use than APL2, simpler to implement, and more general. For example, I think one of the APL2 gurus suggested adding vectors to matrix rows by doing (pardon me if I get this wrong, please) v+[1]m. Swell. Now, replace the + with a user-defined function whose only contents is +, and tell me why: v foo[1] m doesn't work. Robert Bernecky rbe@yrloc.ipsa.reuter.com bernecky@itrchq.itrc.on.ca Snake Island Research Inc (416) 368-6944 FAX: (416) 360-4694 18 Fifth Street, Ward's Island Toronto, Ontario M5J 2B9 Canada