[Openmcl-devel] with-package

Taoufik Dachraoui dachraoui.taoufik at gmail.com
Mon Jan 14 11:55:08 PST 2013


This implementation is just the start to see check the concept and if it is
useful; it is not robust and do not deal with
exceptional situations (like use/unuse ccl)

I will modify the code such that when you use ccl or common-lisp-user it
does nothing (those packages are used in all new packages)

But I understand your test and when use a package other than ccl or
common-lisp-user it works fine:

? (with-package (calculus)
           (let ((#1=#:hello 'world))
             (print (list #1# #1#))))

(WORLD WORLD)
(WORLD WORLD)

why you say the code contains a lot of non-conforming code? but anyway,
this can be corrected once
i know what is conforming and what is not

what is important at this point is to see if the concept is working and if
it is useful, anything else can be corrected


I do not understand the following:

"FILE-WRITE-DATE could return nil while the file is still loadable.
If you don't want to modify the package if the file can't be openned,
you can open it with WITH-OPEN-FILE, and pass the file-stream to LOAD."

Kind regards
Taoufik



On Mon, Jan 14, 2013 at 8:07 PM, Pascal J. Bourguignon <
pjb at informatimago.com> wrote:

> Taoufik Dachraoui <dachraoui.taoufik at gmail.com> writes:
>
> > Hi
> >
> > I hope this time it is ok,
>
> Far from it.  You need at least one or two years studying lisp before
> getting close.
>
> You have a lot of non-conforming code (starting with your defpackage
> form).
>
> FILE-WRITE-DATE could return nil while the file is still loadable.
> If you don't want to modify the package if the file can't be openned,
> you can open it with WITH-OPEN-FILE, and pass the file-stream to LOAD.
>
>
> cl-user> (load "mb.lisp")
> ;Compiler warnings for "/home/pjb/mb.lisp" :
> ;   In homeless-symbol-reader: Variable stream not ignored.
> #P"/home/pjb/mb.lisp"
> cl-user> (use-package :mb)
> t
> cl-user> (with-package (cl-user)
>            (let ((#1=#:hello 'world))
>              (print (list #1# #1#))))
> > Debug: cannot unuse package #<Package "COMMON-LISP-USER">
> >
> > While executing: (:internal swank::invoke-default-debugger), in process
> repl-thread(25).
> > Type :POP to abort, :R for a list of available restarts.
> > Type :? for other options.
> 1 > :q
> ; Evaluation aborted on #<simple-error #x302001CB87FD>.
>
>
> --
> __Pascal Bourguignon__                     http://www.informatimago.com/
> A bad day in () is better than a good day in {}.
>
> _______________________________________________
> Openmcl-devel mailing list
> Openmcl-devel at clozure.com
> http://clozure.com/mailman/listinfo/openmcl-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.clozure.com/pipermail/openmcl-devel/attachments/20130114/209aa2f3/attachment.htm>


More information about the Openmcl-devel mailing list