Path: utzoo!attcan!uunet!lll-winken!lll-lcc!ames!mailrus!iuvax!pur-ee!a.cs.uiuc.edu!uxc.cso.uiuc.edu!uicsrd.csrd.uiuc.edu!jaxon From: jaxon@uicsrd.csrd.uiuc.edu Newsgroups: comp.lang.apl Subject: Re: encode question Message-ID: <49700003@uicsrd.csrd.uiuc.edu> Date: 18 Jul 88 15:23:00 GMT References: <6238@umn-cs.cs.umn.edu> Lines: 20 Nf-ID: #R:umn-cs.cs.umn.edu:6238:uicsrd.csrd.uiuc.edu:49700003:000:794 Nf-From: uicsrd.csrd.uiuc.edu!jaxon Jul 18 10:23:00 1988 As author of the "Represent" (aka "encode") definition as printed in the ISO standard, I should perhaps explain. Just as 10 is not a valid digit in base 10, so 1 is not a valid digit in base 1. I realize that "unary notation" (tallying) is often mistaken for a "positional" (fixed radix) number system, but the two concepts are centuries apart. Many APL statements produce a "unary" form of an integer argument, one close to what you'd expect from encode is: (reverse iota LIMIT) jot . leq N for origin 1, non-negative integers N. This is the traditional low-budget histogram program. (Actually ' *'[#IO + (above expr)] looks better). If you're wondering where the 2 goes in 1 1 1 1 encode 2, try 0 1 1 1 1 encode 2. Also try 0 1 encode 2.71828. regards - greg jaxon