<br><br><div class="gmail_quote">---------- Forwarded message ----------<br>From: <b class="gmail_sendername">Jean-Claude Beaudoin</b> <span dir="ltr"><<a href="mailto:jean.claude.beaudoin@gmail.com">jean.claude.beaudoin@gmail.com</a>></span><br>
Date: Thu, Aug 25, 2011 at 5:28 PM<br>Subject: Re: [mkcl-devel] Add new alias command<br>To: Kaïraba Cissé <<a href="mailto:ckairaba@gmail.com">ckairaba@gmail.com</a>><br><br><br>Hello Kaïraba,<br><br>Using the old stand-alone REPL, are we?<br>
<br>Weren't you using SLIME instead lately? ;-)<br><br>Joke aside, I tried your piece of code in my .mkclrc and it works perfectly.<br>Here is exactly what I inserted:<div class="im"><br>
<br>(setf (cdar si::*tpl-commands*)<br> (append (cdar si::*tpl-commands*) <br> '(((:bye) quit :eval<br></div> ":bye Exit Lisp (a la Kairaba)"<br> ":bye &eval &optional (status 0) [Top level command]~@<br>
~@<br> Exit Lisp (Kairaba's way) without further confirmation.~%"))))<br><br><br>And here is what I get at the command line:<br><br>jean-claude@mars> mkcl-1.0.1 <br>Loading ~/.mkclrc!<br>Done with loading asdf ~/.mkclrc!<br>
Done with configuring asdf ~/.mkclrc!<br><br>This is ManKai Common Lisp 1.0.1<br><br>Copyright (C) 1984 Taiichi Yuasa and Masami Hagiya<br>Copyright (C) 1993 Giuseppe Attardi<br>Copyright (C) 2000 Juan J. Garcia-Ripoll<br>
Copyright (C) 2010-2011 Jean-Claude Beaudoin<br><br>ManKai Common Lisp (MKCL) is free software,<br>and you are welcome to redistribute and/or<br>modify it under the terms of the GNU LGPL.<br>See file 'Copyright' in the source code for details.<br>
<br>Type :h for Help.<br>Top level in: #<thread "Initial" (21173) 000000000291dd80>.<br>> :h<br><br>Top level commands:<br>:cf Compile file.<br>:exit or ^D Exit Lisp.<br>:ld Load file.<br>
:step Single step form.<br>:tr(ace) Trace function.<br>:untr(ace) Untrace function.<br>:w(ho-)b(inds) Show function invocations currently binding variable.<br>:bye Exit Lisp (a la Kairaba).<br><br>
Help commands:<br>:apropos Apropos.<br>:doc(ument) Document.<br>:h(elp) or ? Help. Type ":help help" for more information.<br>> :bye<br>jean-claude@mars> <br><br><br>So the :bye command shows up right where you wanted it and works as expected.<br>
I am then a bit at a loss trying to figure out what is going wrong on your side.<br><br><br><div class="gmail_quote"><div><div></div><div class="h5">On Thu, Aug 25, 2011 at 10:53 AM, Kaïraba Cissé <span dir="ltr"><<a href="mailto:ckairaba@gmail.com" target="_blank">ckairaba@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Hi jean-claude<br>I wanted to add new aliases in mkcl.<br>So, I add the following code in my .mkclrc file :<br>
<b>(setf (cdar si::*tpl-commands*) <br> (append (cdar si::*tpl-commands*) '(((:bye) quit :eval "" ""))))</b><br>
Howerver, it doesn't work at all.<br>I think the issue comes from the file mkcl-1.0.1/src/lsp/top.lsp on line 504.<br>We must replace the line 504 by :<br><b>(&key ((:commands *tpl-commands*) *tpl-commands*)</b><br>
<br>What do you think about that ?<br><br></blockquote></div></div><div><br>Well, this is debatable here but let me very clearly stress that tpl-commands vs *tpl-commands* is not the source of your immediate concerns. Your modification in .mkclrc of a sub-part of the commands list happens well before the value of tpl-commands is sampled and it can be seen from either variables.<br>
<br>Now, this aside, my thinking was that a call to "interactive-loop" without a :commands argument would normally be done by "top-level" or something equivalent to establish a new top-level REPL with a fresh context. This is clearly different from the debugger or the inspector that need to establish a sub-level with a sub-REPL of their own and its augmented set of commands to serve their specialized purpose.<br>
<br>This matters of course only on recursive calls to "interactive-loop". With the code as it stands now you have the choice between setting a clean slate with a standard set of commands or keep on augmenting the inherited set of commands. If the code is modified the way you suggest we get locked into augmenting what we get from above and we lose the ability to easily reset to a standard set of commands is lost.<br>
<br>If there is something that interferes with the customizability of the initial command set by the user it is the use of "defconstant" for the declaration of tpl-commands. It should most probably be replaced by "defparameter" or "defvar".<br>
<br>Cheers,<br><font color="#888888"><br>Jean-Claude<br><br></font></div></div>
</div><br>