🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.functional
Article #461

Extensional functions in SML?

#461
From: Dennis Heimbigner
Date: Tue, 18 Sep 1990 18:04
24 lines
1362 bytes
I have only recently begun to look at SML and I am curious
as to the best method for representing functions that are
defined by specifying a set of pairs of values, where the set contents
varies over time.  This is more-or-less analogous to prolog assert/retract
or to functional data base model base functions.

For example, I want to associate the set of pairs:
	(1,2)
	(17,9)
	(23,-1)
with the function f, such that e.g, f(17) = 9, and so on.
Then I want to be able to change this set by replacing some
pairs and have the function f reflect these changes.

The only way I can see to do this in SML is to
associate a variable, f_var, with f such that f_var
contains the set of pairs.  Modifying the set then
consists of reconstructing the set and re-storing it into
the variable.

Is there some simpler &/or cleaner approach to this?

-Dennis Heimbigner
(dennis@boulder.colorado.edu)
Technical Details
Message-ID: <26470@boulder.Colorado.EDU>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rutgers!cs.utexas.edu!asuvax!ncar!boulder!dennis

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rutgers!cs.utexas.edu!asuvax!ncar!boulder!dennis
From: dennis@boulder.Colorado.EDU (Dennis Heimbigner)
Newsgroups: comp.lang.functional
Subject: Extensional functions in SML?
Message-ID: <26470@boulder.Colorado.EDU>
Date: 18 Sep 90 18:04:13 GMT
Sender: news@boulder.Colorado.EDU
Distribution: usa
Organization: University of Colorado, Boulder
Lines: 24
Originator: dennis@dennis.colorado.edu