Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!watmath!clyde!cbatt!ucbvax!sdcsvax!net1!graifer From: graifer@net1.UUCP Newsgroups: comp.lang.apl Subject: Re: APL puzzle based on Unix' Escapes Message-ID: <427@net1.UCSD.EDU> Date: Sun, 1-Mar-87 23:57:59 EST Article-I.D.: net1.427 Posted: Sun Mar 1 23:57:59 1987 Date-Received: Mon, 2-Mar-87 21:33:14 EST References: <29000002@infbs.UUCP> <4000002@hpcvck.HP> Reply-To: graifer@net1.UUCP (Dan Graifer) Organization: U.C. San Diego Lines: 28 In article <4000002@hpcvck.HP> paull@hpcvck.HP (Paul Liebert) writes: >What about > >FUN {is assigned} 1 {drop} {nand} {scan} 1 {catenate} '\' {equals} STRING > ^ > {negate} > I tried this, and it didn't seem to work... I got two ones followed by a string of zeros almost all cases. A little reflection revealed the error. It is a result of a common confusion about the scan operator used with non-associative diadic primitives. if: R {is assigned} f\V then R[I] {is assigned} f/I{take}V for all I {element of} {iota}{rho}V and (this is the key) the COMPRESS EVALUATES RIGHT TO LEFT. Thus, {nand}\1 1 0 0 0 1 0 0 1 1 {comment} not 1 0 1 1 1 ! -- Dan Graifer graifer@net1.UCSD.EDU Disclaimer: Nobody ever listens to me anyways; Why should they start now?