summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
51a6847)
In particular, with-parsed-body and setf-default are useful.
`stringify'. The START and END arguments may be used to parse out a
substring."
(setf str (stringify str))
`stringify'. The START and END arguments may be used to parse out a
substring."
(setf str (stringify str))
- (unless end
- (setf end (length str)))
+ (setf-default end (length str))
(let ((addr 0) (noct 0))
(loop
(let* ((pos (position #\. str :start start :end end))
(let ((addr 0) (noct 0))
(loop
(let* ((pos (position #\. str :start start :end end))
(defun string-ipnet (str &key (start 0) (end nil))
"Parse an IP-network from the string STR."
(setf str (stringify str))
(defun string-ipnet (str &key (start 0) (end nil))
"Parse an IP-network from the string STR."
(setf str (stringify str))
- (unless end (setf end (length str)))
+ (setf-default end (length str))
(let ((sl (position #\/ str :start start :end end)))
(if sl
(make-ipnet (parse-ipaddr (subseq str start sl))
(let ((sl (position #\/ str :start start :end end)))
(if sl
(make-ipnet (parse-ipaddr (subseq str start sl))
#! /usr/local/bin/runlisp
;;; -*-lisp-*-
#! /usr/local/bin/runlisp
;;; -*-lisp-*-
(clc:clc-require "zone")
(zone.frontend:main)
(clc:clc-require "zone")
(zone.frontend:main)
(setf types (listify types))
(let* ((type (car types))
(func (intern (format nil "ZONE-PARSE/~:@(~A~)" type))))
(setf types (listify types))
(let* ((type (car types))
(func (intern (format nil "ZONE-PARSE/~:@(~A~)" type))))
- (multiple-value-bind (doc decls body) (parse-body body)
+ (with-parsed-body (doc decls body body)
(with-gensyms (col tname ttype tttl tdata tdefsubp i)
`(progn
(dolist (,i ',types)
(with-gensyms (col tname ttype tttl tdata tdefsubp i)
`(progn
(dolist (,i ',types)