On Tue, 2007-07-31 at 10:31 -0700, Erick Tryzelaar wrote:
> On 7/31/07, skaller <[EMAIL PROTECTED]> wrote:

> I kind of like this idea. It feels lispy. Say { ... } actually created
> a raw stack frame, where the thing it was passed to had access to all
> the internal values and variables. This raw stack frame then could be
> passed to the "class" function which breaks apart the stack frame to
> create a class. Something similar could be done with "fun"s and
> "proc"s. As a side benefit, you could just pass a raw stack frame to a
> function, and it would look almost exactly like a record.

> I've got no idea how this could be implemented and typed though.

Well, we have already:

//////////////////
#import <flx.flxh>

obj f(x:int) {
  var a = x;
  fun get():int=>a;
}

var r = f 1;
println$ r.get();
///////////////////

The thing is, a stack frame already is a record but the internals
are deliberately hidden: abstraction. With an object like f,
inner functions are returned in a struct. (BTW: the return type
has to be specified!)


-- 
John Skaller <skaller at users dot sf dot net>
Felix, successor to C++: http://felix.sf.net

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Felix-language mailing list
Felix-language@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/felix-language

Reply via email to