From 50df94fd2a0fce7a2499a8ceafd6034adc69779e Mon Sep 17 00:00:00 2001 From: Colin Okay Date: Sat, 12 Mar 2022 19:07:19 -0600 Subject: bugfix: s/defstruct/defplist. made defplist --- lib/oneliner.lisp | 37 +++++++++++++++++-------------------- 1 file changed, 17 insertions(+), 20 deletions(-) (limited to 'lib/oneliner.lisp') diff --git a/lib/oneliner.lisp b/lib/oneliner.lisp index 39aad0d..4828b2d 100644 --- a/lib/oneliner.lisp +++ b/lib/oneliner.lisp @@ -18,7 +18,7 @@ (in-package :oneliners.cli) -(defstruct oneliner +(defplist oneliner id name oneliner @@ -78,22 +78,19 @@ (concatenate 'string "~" (prin1-to-string *term-width*) "<~a~;by ~a~>~%"))) (loop repeat *term-width* do (princ #\_)) (terpri) - (with-slots - (id name isflagged islocked runstyle tags createdby brief oneliner) ol - - (format t title-line-format-str - id - (or name " ") - (format nil "~:[ ~;⚠~]~:[ ~;🔒~]~:[ ~;📋~]" - isflagged - islocked - (equalp "manual" runstyle))) - (format t tags-line-format-string - (format nil "tags: ~{~a~^ ~}" tags) - createdby) - (loop - for x from 0 to (length brief) by *term-width* - do (format t "~a~%" - (string-trim '(#\space) - (alexandria-2:subseq* brief x (+ x *term-width*))))) - (format t "~%~a~%~%" oneliner)))) + (format t title-line-format-str + (oneliner-id ol) + (or (oneliner-name ol) " ") + (format nil "~:[ ~;⚠~]~:[ ~;🔒~]~:[ ~;📋~]" + (oneliner-isflagged ol) + (oneliner-islocked ol) + (equalp "manual" (oneliner-runstyle ol)))) + (format t tags-line-format-string + (format nil "tags: ~{~a~^ ~}" (oneliner-tags ol)) + (oneliner-createdby ol)) + (loop + for x from 0 to (length (oneliner-brief ol)) by *term-width* + do (format t "~a~%" + (string-trim '(#\space) + (alexandria-2:subseq* (oneliner-brief ol) x (+ x *term-width*))))) + (format t "~%~a~%~%" (oneliner-oneliner ol)))) -- cgit v1.2.3