~mdw
/
zone
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
net.lisp: Print addresses and nets usefully when `*print-escape*' is off.
[zone]
/
net.lisp
diff --git
a/net.lisp
b/net.lisp
index
d245e91
..
7996827
100644
(file)
--- a/
net.lisp
+++ b/
net.lisp
@@
-269,8
+269,10
@@
(:documentation "Transform the address IP into a numeric textual form."))
(defmethod print-object ((addr ipaddr) stream)
(:documentation "Transform the address IP into a numeric textual form."))
(defmethod print-object ((addr ipaddr) stream)
- (print-unreadable-object (addr stream :type t)
- (write-string (ipaddr-string addr) stream)))
+ (if *print-escape*
+ (print-unreadable-object (addr stream :type t)
+ (write-string (ipaddr-string addr) stream))
+ (write-string (ipaddr-string addr) stream)))
(export 'ipaddrp)
(defun ipaddrp (ip)
(export 'ipaddrp)
(defun ipaddrp (ip)
@@
-388,8
+390,10
@@
(ipaddr-string (make-instance (class-of net) :addr mask))))))
(defmethod print-object ((ipn ipnet) stream)
(ipaddr-string (make-instance (class-of net) :addr mask))))))
(defmethod print-object ((ipn ipnet) stream)
- (print-unreadable-object (ipn stream :type t)
- (write-string (ipnet-string ipn) stream)))
+ (if *print-escape*
+ (print-unreadable-object (ipn stream :type t)
+ (write-string (ipnet-string ipn) stream))
+ (write-string (ipnet-string ipn) stream)))
(defun parse-subnet (class width max str &key (start 0) (end nil) (slashp t))
"Parse a subnet description from (a substring of) STR.
(defun parse-subnet (class width max str &key (start 0) (end nil) (slashp t))
"Parse a subnet description from (a substring of) STR.
@@
-1162,7
+1166,9
@@
(cons ipn ipns)))
ipns
:initial-value nil)))
(cons ipn ipns)))
ipns
:initial-value nil)))
- (or merged (error "No matching addresses.")))))
+ (or merged
+ (error "No addresses match ~S~:[ in family ~S~;~*~]."
+ form (eq family t) family)))))
(export 'net-host)
(defun net-host (net-form host &optional (family t))
(export 'net-host)
(defun net-host (net-form host &optional (family t))
@@
-1279,7
+1285,8
@@
:initial-value nil))
(car list))))
(unless (host-addrs host)
:initial-value nil))
(car list))))
(unless (host-addrs host)
- (error "No matching addresses."))
+ (error "No addresses match ~S~:[ in family ~S~;~*~]."
+ addr (eq family t) family))
host)))
(export 'host-create)
host)))
(export 'host-create)