From 79034bc94a81987ad76b8c8f7ab448c70a59d4cd Mon Sep 17 00:00:00 2001 From: briantrice Date: Tue, 2 Feb 2010 15:28:53 -0800 Subject: [PATCH] Added asOptionalSelector to Symbol for convenient conversion from regular selector to an argument for &optionals. --- src/core/symbol.slate | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/core/symbol.slate b/src/core/symbol.slate index b2b5b07..9ec95d7 100644 --- a/src/core/symbol.slate +++ b/src/core/symbol.slate @@ -121,6 +121,11 @@ s@(Symbol traits) isOptionalSelector s name first = $& ]. +s@(Symbol traits) asOptionalSelector +[ + ('&' ; s ; ':') intern +]. + s@(Symbol traits) arity "Answers in a relatively safe way the number of arguments that such a Symbol would take if used as a selector. Keyword selectors must end in a colon." -- 2.11.4.GIT