Skip to content

Commit

Permalink
Fixed issues in imports.
Browse files Browse the repository at this point in the history
  • Loading branch information
svetlyak40wt committed Jan 5, 2022
1 parent 8c52dc8 commit a39b4a8
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 19 deletions.
8 changes: 8 additions & 0 deletions src/doc/changelog.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@
"HTML"
"HTTP")
:external-links (("Ultralisp" . "https://ultralisp.org")))
(0.41.0 2022-01-05
"""
Removed
=======
* Function `reblocks/utils/misc:asdf-system-directory`. Use `asdf:system-source-directory` instead.
""")
(0.40.0 2022-01-03
"""
Added
Expand Down
13 changes: 11 additions & 2 deletions src/linguistic/grammar.lisp
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
(defpackage #:reblocks/linguistic/grammar
(:use #:cl)
(:import-from #:metatilities
#:substring
#:string-ends-with)
(:import-from #:reblocks/utils/i18n
#:translate)
(:export #:pluralize
#:singularize
#:proper-number-form
Expand Down Expand Up @@ -157,8 +162,6 @@ apple' for 'apple' and 'a table' for 'table'."
:masculine))

(defun default-translation-function (string &key plural-p genitive-form-p items-count accusative-form-p &allow-other-keys)
(declare (ignore args))

(when plural-p
(setf string (pluralize string)))

Expand All @@ -172,3 +175,9 @@ apple' for 'apple' and 'a table' for 'table'."
(setf string (proper-number-form items-count string)))

string)


(eval-when (:compile-toplevel :load-toplevel :execute)
(unless *translation-function*
(setf *translation-function*
'default-translation-function)))
11 changes: 10 additions & 1 deletion src/utils/clos.lisp
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
(defpackage #:reblocks/utils/clos
(:use #:cl)
(:import-from #:closer-mop
#:slot-definition-name
#:class-slots
#:class-direct-superclasses
#:class-direct-slots)
(:import-from #:alexandria
#:compose)
(:import-from #:metatilities
#:curry-after)
(:export #:slot-value-by-path
#:find-slot-dsd
#:find-slot-esd
Expand Down Expand Up @@ -87,7 +96,7 @@ method to change the name for particular objects.")
(when diff
(error "Objects with differing slot names detected. Difference: ~S~%" diff))
(dolist (slotname slotnames-o1 t)
(unless (member slotname (ensure-list exclude) :test #'eq)
(unless (member slotname (uiop:ensure-list exclude) :test #'eq)
(cond
((or (and (slot-boundp o1 slotname) (not (slot-boundp o2 slotname)))
(and (slot-boundp o2 slotname) (not (slot-boundp o1 slotname))))
Expand Down
6 changes: 1 addition & 5 deletions src/utils/i18n.lisp
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
(defpackage #:reblocks/utils/i18n
(:use #:cl)
(:import-from #:reblocks/linguistic/grammar
#:default-translation-function)

(:export #:*translation-function*
#:translate
#:default-translation-function))
Expand All @@ -13,8 +10,7 @@
;; it more pluggable, probably by making translate a
;; a generic function. Or may be to remove i18n at all?


(defvar *translation-function* 'default-translation-function)
(defvar *translation-function* nil)


(defun translate (string &rest scope)
Expand Down
5 changes: 4 additions & 1 deletion src/utils/list.lisp
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
(defpackage #:reblocks/utils/list
(:use #:cl)
(:import-from #:anaphora
#:it
#:aif)
(:export #:safe-subseq
#:alist->plist
#:insert-after
Expand Down Expand Up @@ -86,7 +89,7 @@ item before passing it to 'predicate'."

(defun list-starts-with (list elements &key (test 'eq))
"Determines if a list starts with the given elements."
(let ((elements (ensure-list elements)))
(let ((elements (uiop:ensure-list elements)))
(if elements
(when (funcall test (car list) (car elements))
(list-starts-with (cdr list) (cdr elements) :test test))
Expand Down
19 changes: 9 additions & 10 deletions src/utils/misc.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@
#:digest-sequence)
(:import-from #:babel
#:string-to-octets)
(:import-from #:anaphora
#:it
#:aand)
(:import-from #:f-underscore
#:_
#:f_)
(:import-from #:closer-mop
#:funcallable-standard-object
#:required-args)
(:export #:gen-id
#:safe-apply
#:safe-funcall
Expand All @@ -15,7 +24,6 @@
#:public-file-relative-path
#:public-files-relative-paths
#:symbol-status
#:asdf-system-directory
#:hash-keys
#:append-custom-fields
#:function-designator-p
Expand Down Expand Up @@ -103,15 +111,6 @@ etc.)"

(defvar *asdf-system-cache* (make-hash-table :test #'equalp))

(defun asdf-system-directory (asdf-system-name)
"Computes the directory in which the .asdf file for a given ASDF
system resides."
(sor (gethash asdf-system-name *asdf-system-cache*)
(setf it (make-pathname :directory
(pathname-directory
(truename
(asdf:system-definition-pathname
(asdf:find-system asdf-system-name))))))))

(defun hash-keys (hashtable)
"Returns all keys in the hashtable."
Expand Down
2 changes: 2 additions & 0 deletions src/utils/string.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
(:use #:cl)
(:import-from #:cl-fad
#:pathname-as-directory)
(:import-from #:metatilities
#:whitespacep)
(:export #:humanize-name
#:attributize-name
#:string-whitespace-p
Expand Down
2 changes: 2 additions & 0 deletions src/widgets/mop.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
(:import-from #:anaphora
#:awhen
#:it)
(:import-from #:closer-mop
#:subclassp)
(:shadowing-import-from #:closer-mop
#:standard-class
#:validate-superclass
Expand Down

0 comments on commit a39b4a8

Please sign in to comment.