🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.functional
Article #10

Re: Functional == Imperative

#10
From: Martin Odersky
Date: Tue, 27 Oct 1992 18:47
28 lines
1792 bytes
In article <1ccaamINNgbt@uwm.edu> markh@csd4.csd.uwm.edu (Mark) writes:
>    I've been working on a new approach to functional programming that's
> resulted in quite a few interesting ideas.  The approach is based on the
> discovery of a fundamental correspondence between functional and  
imperative
> languages.  So I'd like to bandy about a few of the insights.
> 
> (1) Assignment-Let correspondence.
>    The basis of the correspondence is the following:
> 
>                 assignment statement <-> let statement.
> 
I like the idea of integrating functional and imperative programming, but  
don't think this particular correspondence holds up under close  
inspection. For instance, what do you do about procedures? E.g.

  let a = 0
  let inc cont = let a = a + 1 in cont
  in inc (inc (inc done))

clearly does not do three increments in the last line.
If your answer is: "expand the code of all procedures before
binding any variables" then you have essentially Forsythe.
If you treat instead the global state as an updateable function then you  
have essentially a denotational semantics of an imperative language.
In any case, something quite un-let-like goes on.

-- Martin Odersky
Technical Details
Message-ID: <1992Oct27.184717.15170@cs.yale.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!charon.amdahl.com!pacbell.com!sgiblab!zaphod.mps.ohio-state.edu!cs.utexas.edu!qt.cs.utexas.edu!yale.edu!cs.yale.edu!news
References: <1ccaamINNgbt@uwm.edu>

Show Full Headers
Complete Article Headers
Newsgroups: comp.lang.functional
Path: arc1-ca.pugleaf.net!sparky!uunet!charon.amdahl.com!pacbell.com!sgiblab!zaphod.mps.ohio-state.edu!cs.utexas.edu!qt.cs.utexas.edu!yale.edu!cs.yale.edu!news
From: odersky@pigeon.CS.YALE.EDU (Martin Odersky)
Subject: Re: Functional == Imperative
Message-ID: <1992Oct27.184717.15170@cs.yale.edu>
Sender: news@cs.yale.edu (Usenet News)
Nntp-Posting-Host: pigeon.systemsz.cs.yale.edu
Organization: Yale University, Department of Computer Science, New Haven, CT
References: <1ccaamINNgbt@uwm.edu>
Date: Tue, 27 Oct 1992 18:47:17 GMT
Lines: 28