gusl: (Default)
[personal profile] gusl
flet saves us from repeating often-used arguments:

(defun funky (x)
  (flet ((mult (y) (* x y)))
    (mult 4)))

(funky 5)
=> 20

A more realistic example, in which we want functions to use implicit arguments: (Coming soon...)


It would be nice to have something to automatically bring a function in and out of an flet, i.e. the scope of another function.
* flet2defun would make explicit the implicit arguments (i.e. variables that are global relative to the flet) by adding these variables to the lambda list.
* defun2flet would do the opposite: it would make the lambda list shorter by eliminating arguments already defined in the new scope. The latter can be accomplished by currying.


This implicit/explicit distinction can be observed in C++: class methods can use class properties as well as arguments passed. Class properties are usually seen as not being "inherent" to the function, or at least it's not what one should focus on when trying to understanding what the function does.
From:
Anonymous (will be screened)
OpenID (will be screened if not validated)
Identity URL: 
User
Account name:
Password:
If you don't have an account you can create one now.
Subject:
HTML doesn't work in the subject.

Message:

 
Notice: This account is set to log the IP addresses of everyone who comments.
Links will be displayed as unclickable URLs to help prevent spam.

Profile

gusl: (Default)
gusl

December 2016

S M T W T F S
    123
45678910
11121314151617
18 192021222324
25262728293031

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags