Subject: [clisp-list] completion breaks in linux package

From: Peter Wood <[email-masked]>
Date: Wed, 4 Jul 2001 21:40:18 +0200

Hi

(linux:get_ <TAB> => 

*** - SYSTEM::FUNCTION-SIGNATURE: #<FOREIGN-FUNCTION
"get_current_dir_name" #x0805007C> is not a function.

Although (linux:get_current_dir_name) works.

Completion works in the other packages.

I am using clisp-2.26, on Gnu/linux 2.4.5, with all the packages
except postgres and queens.

Regards,
Peter

---

From: Sam Steingold <[email-masked]>
Date: 09 Jul 2001 10:59:23 -0400

> * In message <[email-masked]>
> * On the subject of "[clisp-list] completion breaks in linux package"
> * Sent on Wed, 4 Jul 2001 21:40:18 +0200
> * Honorable Peter Wood <[email-masked]> writes:
> 
> (linux:get_ <TAB> => 
> 

try this:

user[6]: > (disassemble 'sys::function-signature)
Disassembly of function system::function-signature
(CONST 0) = system::function-name-p
(CONST 1) = fdefinition
(CONST 2) = system::signature
(CONST 3) = 16
(CONST 4) = 12
(CONST 5) = 13
(CONST 6) = 19
(CONST 7) = 18
(CONST 8) = ffi:foreign-function
(CONST 9) = system::foreign-function-in-arg-count
(CONST 10) = 0
(CONST 11) = "~S: ~S is not a function."
(CONST 12) = system::language
(CONST 13) = system::function-signature
1 required arguments
1 optional arguments
No rest parameter
No keyword parameters
0     (unbound->nil 1)
2     (load&push 2)
3     (call1&jmpifnot 0 l14)              ; system::function-name-p
6     (load&push 2)
7     (calls1&jmpifnot 79 l14)            ; fboundp
10    (load&push 2)
11    (call1 1)                           ; fdefinition
13    (store 2)
14    l14
14    (load&push 2)
15    (calls2&jmpif 8 l58)                ; system::closurep
18    (load&push 2)
19    (calls2&push 37)                    ; type-of
21    (jmpifeqto 8 l102)                  ; ffi:foreign-function
25    (load&push 2)
26    (calls1 1)                          ; system::subr-info
28    (nv-to-stack 6)
30    (load&jmpifnot 5 l116)
34    (push)
35    (load&push 5)
36    (load&push 5)
37    (load&push 5)
38    (load 5)
39    l39
39    (push)
40    (load&push 6)
41    (load&push 6)
42    (stack-to-mv 7)
44    (skip&ret 9)
46    l46
46    (load&push 2)
47    (call1 2)                           ; system::signature
49    (nv-to-stack 6)
51    (load&push 8)
52    (load&push 6)
53    (load&push 6)
54    (load&push 6)
55    (load 6)
56    (jmp l39)
58    l58
58    (load&push 2)
59    (calls2&jmpif 7 l46)                ; compiled-function-p
62    (load&push 2)
63    (const&push 3)                      ; 16
64    (calls2&push 41)                    ; system::%record-ref
66    (load&push 3)
67    (load&push 4)
68    (const&push 4)                      ; 12
69    (calls2&push 41)                    ; system::%record-ref
71    (load&push 5)
72    (const&push 5)                      ; 13
73    (calls2&push 41)                    ; system::%record-ref
75    (load&push 6)
76    (const&push 6)                      ; 19
77    (calls2&push 41)                    ; system::%record-ref
79    (load&push 4)
80    (calls2 6)                          ; numberp
82    (not)
83    (push)
84    (load&push 5)
85    (calls2 6)                          ; numberp
87    (not)
88    (jmpifnot l93)
90    (load&push 5)
91    (calls1 157)                        ; copy-list
93    l93
93    (push)
94    (load&push 9)
95    (const&push 7)                      ; 18
96    (calls2&push 41)                    ; system::%record-ref
98    (stack-to-mv 7)
100   (skip&ret 4)
102   l102
102   (load&push 2)
103   (load&push 3)
104   (call1&push 9)                      ; system::foreign-function-in-arg-count
106   (const&push 10)                     ; 0
107   (push-nil 4)
109   (stack-to-mv 7)
111   (skip&ret 3)
113   l113
113   (values0)
114   (skip&ret 9)
116   l116
116   (load&jmpif 7 l113)
119   (const&push 11)                     ; "~S: ~S is not a function."
120   (push-nil 2)
122   (call&push 3 12)                    ; system::language
125   (const&push 13)                     ; system::function-signature
126   (load&push 10)
127   (callsr 2 30)                       ; error
#<compiled-closure system::function-signature>

does your disassembly mention ffi::foreign-function?
try these:
(fdefinition 'linux:get_current_dir_name)
(type-of *)

did you build your clisp yourself?  CVS or distribution?

Thanks for your bug report

-- 
Sam Steingold (http://www.podval.org/~sds)
Support Israel's right to defend herself! <http://www.i-charity.com/go/israel>
Read what the Arab leaders say to their people on <http://www.memri.org/>
The only time you have too much fuel is when you're on fire.

---

From: Peter Wood <[email-masked]>
Date: Mon, 9 Jul 2001 19:12:46 +0200

> user[6]: > (disassemble 'sys::function-signature)
  
<clipped>

> does your disassembly mention ffi::foreign-function?

No.  It has system::foreign-function where your output said
ffi:foreign-function. 

> (fdefinition 'linux:get_current_dir_name)

The first returns:
 #<FOREIGN-FUNCTION "get_current_dir_name" #x0805007C>

And the second returns:
FFI::FOREIGN-FUNCTION

> did you build your clisp yourself?  CVS or distribution?

I got it from cons.org and built it myself. clisp --version:
GNU CLISP 2.26 (released 2001-05-23) (built 3202023995) (memory
3202025137)

If I remember correctly, I applied all the patches except the
directory access one.

> The only time you have too much fuel is when you're on fire.

:-)

Regards,
Peter

---

From: Sam Steingold <[email-masked]>
Date: 09 Jul 2001 14:18:36 -0400

> * In message <[email-masked]>
> * On the subject of "Re: [clisp-list] completion breaks in linux package"
> * Sent on Mon, 9 Jul 2001 19:12:46 +0200

this bug was introduced during the repackaging and fixed on 2001-06-17.
there are quite a few files involved, so I am reluctant to create a
separate patch.

you can replace "FOREIGN-FUNCTION" with "FFI::FOREIGN-FUNCTION" in the
definition of FUNCTION-SIGNATURE in compiler.lisp to fix your particular
problem, or you can try the CVS version.

Thanks for reporting the bug.

-- 
Sam Steingold (http://www.podval.org/~sds)
Support Israel's right to defend herself! <http://www.i-charity.com/go/israel>
Read what the Arab leaders say to their people on <http://www.memri.org/>
"A pint of sweat will save a gallon of blood."          -- George S. Patton