X-Git-Url: http://git.kpe.io/?p=clsql.git;a=blobdiff_plain;f=base%2Futils.lisp;h=8a96df6642846289ab4603f1449dda00cf95e9b7;hp=9fb6e7c2b59c99af41079353a57270cc4376b186;hb=9bbed78051e80e6ab76ae47834136035602bbbf1;hpb=967266c94b00f91e5967b8330fe2b9134b0c0447 diff --git a/base/utils.lisp b/base/utils.lisp index 9fb6e7c..8a96df6 100644 --- a/base/utils.lisp +++ b/base/utils.lisp @@ -16,7 +16,7 @@ ;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL. ;;;; ************************************************************************* -(in-package #:clsql-base-sys) +(in-package #:clsql-base) (defun number-to-sql-string (num) (etypecase num @@ -257,23 +257,6 @@ returns (VALUES string-output error-output exit-status)" )) -(eval-when (:compile-toplevel :load-toplevel :execute) - (when (char= #\a (schar (symbol-name '#:a) 0)) - (pushnew :lowercase-reader *features*))) - -(defun string-default-case (str) - #-lowercase-reader - (string-upcase str) - #+lowercase-reader - (string-downcase str)) - -;; From KMRCL -(defun ensure-keyword (name) - "Returns keyword for a name" - (etypecase name - (keyword name) - (string (nth-value 0 (intern (string-default-case name) :keyword))) - (symbol (nth-value 0 (intern (symbol-name name) :keyword))))) ;; From KMRCL (defmacro in (obj &rest choices) @@ -342,7 +325,7 @@ list of characters and replacement strings." #+lowercase-reader (string-downcase str)) -(defmethod convert-to-db-default-case (str database) +(defun convert-to-db-default-case (str database) (if database (case (db-type-default-case (database-underlying-type database)) (:upper (string-upcase str)) @@ -351,3 +334,10 @@ list of characters and replacement strings." ;; Default CommonSQL behavior is to upcase strings (string-upcase str))) + +(defun ensure-keyword (name) + "Returns keyword for a name" + (etypecase name + (keyword name) + (string (nth-value 0 (intern (symbol-name-default-case name) :keyword))) + (symbol (nth-value 0 (intern (symbol-name name) :keyword)))))