Re: Missing %get-int in sql/generic-postgresql.lisp
Kevin Rosenberg <kevin-HJRc7zDS/[email protected]> Wed, 21 Sep 2011 10:57:50 -0600
| Newsgroups | gmane.lisp.clsql.general |
|---|---|
| Message-ID | <[email protected]> |
Thanks, Russ.
I'll release a new version of CLSQL today.
Kevin
On Sep 21, 2011, at 7:20 AM, Russ Tyndall wrote:
> Thanks very much for the bug report.
>
> This has been fixed upstream (a couple days after the latest quicklisp
> dist). Sorry for the inconvenience. It probably should have gone into
> the commit msg / changelog, but I was so wrapped up in the other changes
> I was making I forgot to mention it.
>
> git ref: 30186614582039bdc3d3f86bc5165ef300c5d3e0
>
> Cheers,
> Russ
>
>
> On 9/20/2011 8:14 PM, A. Mattox Beckman, Jr. wrote:
>> Hi all,
>>
>> I'm relatively new to common lisp, and to cl-sql. I was trying to
>> write a sample program (best way to learn is to write something) using
>> sequences and encountered the following error. Here is a runtime with
>> Slime 2011-08-26, SBCL 1.0.45, and clsql form the git archive
>> as of 20110829.
>>
>> ; SLIME 2011-08-26:
>> CL-USER> (ql:quickload :clsql)
>> ; Loading system definition from
>> ; /home/mattox/quicklisp/dists/quicklisp/software/uffi-20101107-git/uffi.asd
>> ; into #<PACKAGE "ASDF1">
>> ; Registering #<SYSTEM "uffi">
>> To load "clsql":
>> Load 1 ASDF system:
>> clsql
>> ; Loading "clsql"
>> ......
>> (:CLSQL)
>> CL-USER> (use-package :clsql)
>> T
>> CL-USER> (connect '("localhost" "test" "mattox" "") :database-type :postgresql)
>> #<CLSQL-POSTGRESQL:POSTGRESQL-DATABASE localhost/test/mattox OPEN {100389A971}>
>> CL-USER> (create-sequence 'foo)
>> ; No value
>> CL-USER> (sequence-next 'foo)
>>
>> This causes the error:
>>
>> The function CLSQL-SYS::%GET-INT is undefined.
>> [Condition of type UNDEFINED-FUNCTION]
>>
>>
>> Looking around in the code, I found that the
>> sql/generic-postgresql.lisp file references %GET-INT, which is defined
>> in test/util.
>>
>> (defun %get-int (v)
>> (etypecase v
>> (string (parse-integer v :junk-allowed t))
>> (integer v)
>> (number (truncate v))))
>>
>> So, as a workaround, I put the function into
>> sql/generic-postgresql.lisp, and that solved my problem, so I thought
>> I would write it up in case someone else ran into this or in case I'm
>> missing something that would be obvious to more experienced lispers.
>>
>> Cheers,
>> Mattox
>>
> _______________________________________________
> CLSQL mailing list
> [email protected]
> http://lists.b9.com/cgi-bin/mailman/listinfo/clsql