From 1435eb3d3bddaf2dcf43db9edd3bafcb711af1e5 Mon Sep 17 00:00:00 2001 From: "Brian T. Rice" Date: Sat, 5 Mar 2011 14:06:43 -0800 Subject: [PATCH] Added in:do: aliasing doIn: and commented both methods. --- src/core/method.slate | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/core/method.slate b/src/core/method.slate index ef13f92..2c247ac 100644 --- a/src/core/method.slate +++ b/src/core/method.slate @@ -334,11 +334,18 @@ will return from this wrapper when invoked." [m applyWith: [^ Nil]]. m@(Method traits) doIn: env +"Executes the method without arguments, but having the environment set +to the given one. This is non-reentrant, though, because the environment +slot is per-method-object, not per-activation." [| prevEnv | prevEnv := m environment. [m do] ensure: [m environment := prevEnv] ]. +_@(Root traits) in: env do: m@(Method traits) +"Aliases doIn: for convenient expression." +[m doIn: env]. + m@(Method traits) ** n@(Method traits) "Answers a new Method whose effect is that of calling the first method on the results of the second method applied to whatever arguments are passed. -- 2.11.4.GIT