Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!sun-barr!cs.utexas.edu!usc!sdd.hp.com!think.com!mintaka!bloom-beacon!eru!hagbard!sunic!mcsun!ukc!icdoc!gould!fst From: fst@doc.ic.ac.uk (Frank Taylor) Newsgroups: comp.lang.functional Subject: Re: Implementing Error Values Message-ID: Date: 23 Nov 90 13:25:40 GMT References: <86438@lll-winken.LLNL.GOV> Sender: news@doc.ic.ac.uk Organization: DoC, Imperial College, London SW7, UK. Lines: 43 In-reply-to: miller@lll-crg.llnl.gov's message of 20 Nov 90 16:46:43 GMT In article <86438@lll-winken.LLNL.GOV> miller@lll-crg.llnl.gov (Patrick Miller) writes: > I'm looking for pointers to papers about implementing error values in > functional languages (or other styles). By error values, I mean that > the value of a calculation is replaced by a placeholder denoting the > error. This allows some form of error handling without invoking the > concept of global state. From what I remember, John Backus' FP has just such an idea. It has a value called bottom which is returned when there has been an error. > Example: (plus (div a 0) (plus b c)) ;;; [ (a/0) + (b+c) ] In FP would be: {func +@[/@[1 %0] +@[2 3]]} where the args to func are equivalent a, b and c. > The value of (div a 0) is ERROR. > Therefore the value of (plus (div a 0) (plus b c)) > is also ERROR. Calling: func:<1 2 3> gives back: ? Which is bottom --- cute! I think it says that any function whose arguments contain a ? will return a ?. > What I'm especially looking for is info on implementations of these > values. I pulled an implementation of FP by Andy Valencia from the Sources Archive here at Imperial. You may find useful stuff there. > Pat Miller Professional Student Frank Taylor, another Professional Student Major Disclaimer: The author disclaims all responsibility for any loss or damage incurred by use of the software or knowledge given above. In other words I don't know that much about FP :-)