Re: Anonymous Code Blocks as Lambdas? - Mailing list pgsql-hackers

From David E. Wheeler
Subject Re: Anonymous Code Blocks as Lambdas?
Date
Msg-id 69F6216B-D9AC-42B1-9795-987BDB890859@kineticode.com
Whole thread Raw
In response to Re: Anonymous Code Blocks as Lambdas?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Oct 26, 2009, at 1:21 PM, Tom Lane wrote:

> A lambda facility would require being able to pass arguments and  
> return
> results, which we intentionally left out of DO to keep it simple.  By
> the time you add all that notation, it's far from clear that you
> shouldn't just define a function.

Well sometimes I want to do something like that as an expression,  
rather than having to write a separate statement that declares a  
function.

> Also, DO is (intended to be) optimized for execute-once behavior.
> A lambda block inside a query shouldn't assume that.  So it would  
> not be
> the same facility from either a syntax or an implementation  
> standpoint.

Perhaps lambda isn't the proper term.

Best,

David


pgsql-hackers by date:

Previous
From: "David E. Wheeler"
Date:
Subject: Re: Anonymous Code Blocks as Lambdas?
Next
From: Greg Stark
Date:
Subject: Re: Parsing config files in a directory