Newsgroups: comp.lang.beta Path: news.daimi.aau.dk!news.uni-c.dk!sunic!trane.uninett.no!nac.no!eunet.no!nuug!EU.net!ub4b!idefix.CS.kuleuven.ac.be!reks.uia.ac.be!news From: vaughan@maze.ruca.ua.ac.be (David Vaughan) Subject: Curry Message-ID: <1994Sep25.121732.5463@reks.uia.ac.be> Sender: news@reks.uia.ac.be (USENET News System) Organization: U.I.A. X-Newsreader: TIN [version 1.2 PL2] Date: Sun, 25 Sep 1994 12:17:32 GMT Lines: 39 Lee McGraw (mcgraw@cc.gatech.edu) wrote: > > Multiply : (# a, b : @integer; > enter (a, b) > exit a * b > #) > m : ^Multiply; { m is a reference to multiply objects } > > &Multiply[] -> m[]; { m contains a multiply object } > (2, 3) -> m -> putInt { cause the multiply ACTION of m to occur } > { and the i/o action of putInt to be called } > Someone else (sorry, I forget who) suggested a <- syntax, eg. putInt <- m <- (2, 3) Many functional languages enjoy the clarity of the operator (that was a space character) and would like to write: putInt (m (2, 3)) or, if currying is allowed, putInt (m 2 3) (a) Would this be too outlandish a syntactic style for an imperative language? (b) Syntax aside, have the BETA authors considered currying, or at least something which might be used in this sort of way: (&Multiply[] 2) -> double[]; Does this concept have any meaning in the context of BETA? How would you describe the derivation of double's type from that of a Multiply object? David