evincarofautumn / kitten

A statically typed concatenative systems programming language.
http://kittenlang.org/
Other
1.09k stars 39 forks source link

Add ReplCommand structure to remove redundancy in 'repl' and 'help' #111

Closed kchaloux closed 10 years ago

kchaloux commented 10 years ago

New commands added to the replCommands list should now automatically be registered for use in the repl function, and will show up in the help listing.

evincarofautumn commented 10 years ago

Not done yet. GitHub doesn’t let you reopen closed pull requests that it thinks were merged.

evincarofautumn commented 10 years ago

Closed for realsies:

diff --git a/src/Repl.hs b/src/Repl.hs
index 0f317f6..61a5d27 100644
--- a/src/Repl.hs
+++ b/src/Repl.hs
@@ -94,7 +94,7 @@ data ReplCommand = ReplCommand
 newArgCommand :: [Text] -> (Text -> ReplInput ()) -> Text -> Text -> ReplCommand
 newArgCommand symbols func fmtArgs helpText =
   ReplCommand
-  { cmdSymbols = symbols
+  { cmdSymbols = fmtSymbols
   , cmdFunc = func
   , cmdDesc = ReplCommandDesc
     { descCommand = T.unwords [symbolText, fmtArgs]