[Openmcl-devel] Re: ipaddr-to-dotted
Gary Byers
gb at clozure.com
Thu Nov 21 14:28:39 PST 2002
I don't believe that the second comment (about giving the wrong
result) applies anymore; it was true a few versions ago (because of
confusion about whether small structures - like a "struct ipaddr" -
should be passed by value or by reference.)
I don't know whether Portable Aserve still passes NIL here; John DeSoi
might know.
The CERROR that occurs when a built-in function is redefined can
be suppressed by binding CCL:*WARN-IF-REDEFINE-KERNEL* to NIL at
the point where the definition's made, as in:
(let* ((ccl:*warn-if-redefine-kernel* nil))
(defun ipaddr-to-dotted (...)
...))
On Thu, 21 Nov 2002, Kevin Rosenberg wrote:
> Hi Gary,
>
> I'm working on Portable Aserve for OpenMCL. Currently, openmcl 0.13.1
> does not allow this ccl function to be overridden without a warning. I
> assume that there is some way to disable the warning. But, even
> better, would you consider the below comments and the redefinition and
> let me know if you think that the redefinition is still needed?
>
> Thanks!
>
> --
> Kevin Rosenberg | .''`. ** Debian GNU/Linux **
> http://b9.com/debian.html | : :' : The universal
> GPG signed and encrypted | `. `' Operating System
> messages accepted. | `- http://www.debian.org/
>
>
> ; OpenMCL has a built-in ipaddr-to-dotted. But it appears that sometimes
> ; the log function is being called after the connection is closed and
> ; it causes nil to be passed to ipaddr-to-dotted. So until we have a fix,
> ; we just provide this to deal with nil values. The aserve log-request
> ; method should really check to see that it has a good value.
> ;
> ; Second reason for this: ccl:ipaddr-to-dotted gives the wrong result
> .
> #+ignore
> (defun ccl:ipaddr-to-dotted (ipaddr &key values)
> (if (null ipaddr)
> (if values (values 0 0 0 0) "0.0.0.0")
> (let ((a (logand #xff (ash ipaddr -24)))
> (b (logand #xff (ash ipaddr -16)))
> (c (logand #xff (ash ipaddr -8)))
> (d (logand #xff ipaddr)))
> (if values
> (values a b c d)
> (format nil "~d.~d.~d.~d" a b c d)))))
>
>
_______________________________________________
Openmcl-devel mailing list
Openmcl-devel at clozure.com
http://clozure.com/cgi-bin/mailman/listinfo/openmcl-devel
More information about the Openmcl-devel
mailing list