🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.functional
Article #468

Re: Extensional functions in SML?

#468
From: Simon E Spero
Date: Sat, 22 Sep 1990 21:37
32 lines
1987 bytes
In article <STABL.90Sep20195507@trillian-gw.fmi.uni-passau.de> stabl@unipas.fmi.uni-passau.de (Robert Stabl) writes:
>
>Norman is right, the function names were misleading (esp. the name f).
>But, I wanted to show that (higher-order) functional programming can be used
>to define databases, not implementing them by arrays, lists, or any other
>standard method.
>

The code in your example strongly resembles the way stores are handled in
denotational semantics. Surely the chain of closures that results from this
process would take up much more heap space than the standard methods, and
be O(N) in time? 

Surely it would be better to store the data in a more efficent manner 
(an AVL tree, or suchlike), and to only package it up in function when one 
is needed ; 

foo tree <=
	let f == lambda x => look_up(tree,x) in
	map (f,[1,2,3]


By the way, prehaps the best way of handling this problem is using a 
hash-table, but this is not really an option unless one is prepared to
supply all values in one hit. Ever get the craving for a := ? :-(

Simon
--
zmacx07@uk.ac.ic.doc | sispero@cix.co.uk |    ..!mcsun!ukc!slxsys!cix!sispero
------------------------------------------------------------------------------
The Poll Tax.    | Saddam Hussein runs Lotus 123 on | DoC,IC,London SW7 2BZ
I'm Not. Are you?| Apple Macs.|   I love the smell of Sarin in the morning
Technical Details
Message-ID: <2279@gould.doc.ic.ac.uk>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!mailrus!wuarchive!uunet!mcsun!ukc!icdoc!zmacx07
References: <STABL.90Sep19204925@trillian-gw.fmi.uni-passau.de> <1990Sep20.074513.19190@d.cs.okstate.edu> <STABL.90Sep20195507@trillian-gw.fmi.uni-passau.de>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!mailrus!wuarchive!uunet!mcsun!ukc!icdoc!zmacx07
From: zmacx07@doc.ic.ac.uk (Simon E Spero)
Newsgroups: comp.lang.functional
Subject: Re: Extensional functions in SML?
Message-ID: <2279@gould.doc.ic.ac.uk>
Date: 22 Sep 90 21:37:44 GMT
References: <STABL.90Sep19204925@trillian-gw.fmi.uni-passau.de> <1990Sep20.074513.19190@d.cs.okstate.edu> <STABL.90Sep20195507@trillian-gw.fmi.uni-passau.de>
Sender: news@doc.ic.ac.uk
Reply-To: zmacx07@doc.ic.ac.uk (Simon E Spero)
Organization: Imperial College Department of Computing
Lines: 32