<div dir="ltr"><div><div>Maybe I should explain what I am intending to do.<br><br></div>Basically, I want to overwrite open function to return my specific (gray) stream. instead of usual stream that it would. <br></div>Ideally, all functions/macros that use open should use that function instead, but I am not sure if it is possible.<br>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/1/29 Matthew Mondor <span dir="ltr"><<a href="mailto:mm_lists@pulsar-zone.net" target="_blank">mm_lists@pulsar-zone.net</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On Tue, 29 Jan 2013 15:07:19 +0100<br>
Peter Enerccio <<a href="mailto:enerccio@gmail.com">enerccio@gmail.com</a>> wrote:<br>
<br>
> Hello,<br>
><br>
> I wanted to ask if it is possible to overwrite functions in common-lisp<br>
> package.<br>
> I know I can do it in c level, but I would rather do it in lisp level, if<br>
> it is possible.<br>
<br>
</div>The part that allows to unlock/lock packages is<br>
implementation-dependent, but that can be done on ECL using the<br>
function EXT:PACKAGE-LOCK (the COMMON-LISP package is locked by<br>
default). That said, it's also possible, and portable, to override a<br>
COMMON-LISP package symbol in a specific package which USEs CL, like in<br>
the following example, overriding GENTEMP in FOO:<br>
<br>
(defpackage :foo<br>
(:use :cl))<br>
<br>
(shadow 'gentemp :foo)<br>
(defun foo::gentemp (&rest args)<br>
(error "Call to deprecated function GENTEMP with arguments ~S" args))<br>
<br>
(in-package :foo)<br>
(gentemp 4362642)<br>
<br>
Condition of type: SIMPLE-ERROR<br>
Call to deprecated function GENTEMP with arguments (4362642)<br>
--<br>
Matt<br>
<br>
------------------------------------------------------------------------------<br>
Master Visual Studio, SharePoint, SQL, <a href="http://ASP.NET" target="_blank">ASP.NET</a>, C# 2012, HTML5, CSS,<br>
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current<br>
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft<br>
MVPs and experts. ON SALE this month only -- learn more at:<br>
<a href="http://p.sf.net/sfu/learnnow-d2d" target="_blank">http://p.sf.net/sfu/learnnow-d2d</a><br>
_______________________________________________<br>
Ecls-list mailing list<br>
<a href="mailto:Ecls-list@lists.sourceforge.net">Ecls-list@lists.sourceforge.net</a><br>
<a href="https://lists.sourceforge.net/lists/listinfo/ecls-list" target="_blank">https://lists.sourceforge.net/lists/listinfo/ecls-list</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>Bc. Peter Vaņu¹anik<br><a href="http://www.bishojo.tk" target="_blank">http://www.bishojo.tk</a><br>
</div>