Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!wuarchive!usc!ucsd!pacbell.com!att!rutgers!aramis.rutgers.edu!klaatu.rutgers.edu!josh From: josh@klaatu.rutgers.edu (J Storrs Hall) Newsgroups: comp.lang.apl Subject: Reassignment in J Message-ID: Date: 9 Jan 91 19:25:56 GMT References: <15160009@hpdmd48.boi.hp.com> <1991Jan9.171347.19535@jato.jpl.nasa.gov> Organization: Rutgers Univ., New Brunswick, N.J. Lines: 19 In article <1991Jan9.171347.19535@jato.jpl.nasa.gov>, sam@kalessin.jpl.nasa.gov (Sam Sirlin) writes: > I've not been able to find a way to do the equivalent of reassignment: > A[I] .is X > in J. Is this really impossible? Yes and no. J seems to adhere to some functional language purity standards to the extent of not allowing destructive modification of existing data structures. However the effect can easily be achieved with dyadic merge: A =. X I} A (which is a bit more powerful than reassignment in that it allows you the option of computing the value without modifying A). --JoSH