SPUG: Perl closures

Yitzchak Scott-Thoennes sthoenna at gmail.com
Thu Jul 7 07:57:36 PDT 2016


On Thu, Jul 7, 2016 at 10:06 AM, Mark Hinds <zoro98020 at gmail.com> wrote:

> Question - Perl's anonymous functions seem to operate perfectly well
> as closures - they capture the referenced environment properly and
> free it when they themselves are no longer referenced. The guile
> folks disputed that me those many years ago. Thoughts?
>

 Hard to know what to say without knowing what they were arguing.

They don't in fact capture the environment; they capture specific
lexicals.  This makes a difference if a lexical is only used in the closure
in a string eval.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/spug-list/attachments/20160707/5ee24740/attachment.html>


More information about the spug-list mailing list