From: SourceForge.net <no...@so...> - 2006-01-11 22:47:35
|
Feature Requests item #944803, was opened at 2004-04-29 15:54 Message generated for change (Comment added) made by msofer You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=360894&aid=944803&group_id=10894 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: 22. [proc] and [uplevel] Group: None Status: Open Resolution: None Priority: 5 Submitted By: miguel sofer (msofer) Assigned to: miguel sofer (msofer) Summary: new [apply] command Initial Comment: A proposed new [apply] command to apply anonymous functions, giving one possible (but different) implementation for the goals of TIP 187 (Functions as Values). Attaching a patch that provides the command; a possible manual page is at http://utdt.edu/~mig/apply.html. ---------------------------------------------------------------------- >Comment By: miguel sofer (msofer) Date: 2006-01-11 19:47 Message: Logged In: YES user_id=148712 Comments on coldstore's patches: (1) the idea is more than sound; we need to check if it doesn't break common extensions that include tclInt.h (itcl uses Proc, IIRC). (2) a Proc has to know its namespace in order to (a) cause the body to be compiled in the correct namespace (b) push a CallFrame for the correct namespace before eval'ing the body ---------------------------------------------------------------------- Comment By: miguel sofer (msofer) Date: 2006-01-11 19:33 Message: Logged In: YES user_id=148712 Updated patch apply3.patch, applies to HEAD. Note that this is still a proof-of-concept: missing tests and comments, for instance. ---------------------------------------------------------------------- Comment By: Colin McCormack (coldstore) Date: 2004-08-22 22:09 Message: Logged In: YES user_id=19214 Second patch to remove Command* from Proc. This handles [rename] and properly refcounts Namespace refs held in Procs. ---------------------------------------------------------------------- Comment By: Colin McCormack (coldstore) Date: 2004-08-22 20:41 Message: Logged In: YES user_id=19214 Following discussion on tkchat, it is possible (and desirable) to simplify struct Proc so that it no longer requires a Command, but instead directly points to its defining Namespace ... this will require further modification to the [rename] command, to preserve rename semantics (where renaming a command associated with a proc will change the proc's Namespace) ... to be attached in a different patch. Justification: a proc needs to know its own namespace (although except for the [variable] command, it's hard to know precisely why ... more analysis work needs to be done) but the additional requirement, that it possess an associated command, doesn't seem warranted. The included patch removes that requirement, and should enable eventual simplification of Miguel's [apply] patch by not absolutely requiring it to create a Command to associate with an anonymous proc. This simplification is beneficial with, or without, changes to tcl semantics permitting direct evaluation of a Lambda ObjType. ---------------------------------------------------------------------- Comment By: miguel sofer (msofer) Date: 2004-04-30 07:28 Message: Logged In: YES user_id=148712 Addressing only the first issue, new apply2.patch with manpage at http://utdt.edu/~mig/apply2.html This version executes the anonymous function in the global namespace by default, but a different (constant) namespace can be specified. The remaining two issues are still unaddressed; this is experimental code, those matters will definitely be fixed before applying. ---------------------------------------------------------------------- Comment By: Donal K. Fellows (dkf) Date: 2004-04-30 05:43 Message: Logged In: YES user_id=79902 Issues, some of which are not serious in demo code: * Which is the correct namespace to execute in? * The errorInfo messages are misleading * Should the guts of TclObjInterpProc be extracted so that they can be called from [apply]? IncrTcl (and other extensions?) might also be a client of such a function, even if it was internal, so whatever it is ought to go in the stubs table. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=360894&aid=944803&group_id=10894 |