[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gcl-devel] The "C" package
From: |
Camm Maguire |
Subject: |
[Gcl-devel] The "C" package |
Date: |
Thu, 05 Mar 2009 15:46:20 -0500 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) |
Greetings! Just checked in an initial implementation of lisp access
to all the C struct bits:
GCL (GNU Common Lisp) 2.7.0 ANSI Mar 5 2009 16:32:02
Source License: LGPL(gcl,gmp,pargcl), GPL(unexec,bfd,xgcl)
Binary License: GPL due to GPL'ed components: (XGCL READLINE BFD UNEXEC)
Modifications of this banner must retain notice of a compatible license
Dedicated to the memory of W. Schelter
Use (help) to get some basic information on how to use GCL.
Temporary directory for compiler files set to /tmp/
>(setq a "123")
"123"
>(c::string-self a 1)
#\2
>(c::set-string-self #\4 a 1)
#\4
>a
"143"
>(c::symbol-dbind a)
Error:
Fast links are on: do (si::use-fast-links nil) for debugging
Signalled by EVAL.
Condition in SYSTEM:TOP-LEVEL [or a callee]: INTERNAL-SIMPLE-TYPE-ERROR: "143"
is not of type SYMBOL:
Broken at EVAL. Type :H for Help.
1 (Continue) supply a new value of COMPILER::X.
2 Return to top level.
COMMON-LISP-USER>>2
Top level.
>(c::symbol-dbind 'a)
"143"
>(c::symbol-dbind (gensym))
#<OBJNULL>
>(disassemble 'c::symbol-dbind nil)
;; Compiling /tmp/gazonk_12559_0.lsp.
;; End of Pass 1.
;; End of Pass 2.
;; OPTIMIZE levels: Safety=0 (No runtime error checking), Space=0, Speed=3,
(Debug quality ignored)
;; Finished compiling /tmp/gazonk_12559_0.o.
#include "gazonk_12559_0.h"
void init_code(){do_init((void *)VV);}
/* local entry for function C::SYMBOL-DBIND */
static object LI1__SYMBOL_DBIND___gazonk_12559_0(V2)
register object V2;
{ VMB1 VMS1 VMV1
goto TTL;
TTL:;
if(!(type_of((V2))==t_symbol)){
goto T5;}
goto T3;
goto T5;
T5:;
V2= (VFUN_NARGS=4,(/* SYSTEM::CHECK-TYPE-SYMBOL
*/(*LnkLI3)(((object)VV[0]),(V2),((object)VV[1]),Cnil)));
goto T3;
T3:;
{object V4 = ((V2)->s.s_dbind);VMR1
(V4);}
return Cnil;
}
static object LnkTLI3(object first,...){object V1;va_list
ap;va_start(ap,first);V1=(object )call_vproc_new(((object)VV[3]),0,0,(void
**)(void *)&LnkLI3,first,ap);va_end(ap);return V1;} /*
SYSTEM::CHECK-TYPE-SYMBOL */
#(#(X SYMBOL OBJECT CHECK-TYPE-SYMBOL
(%INIT
. #((LET ((*DISABLE-RECOMPILE* T))
(MFSFUN 'SYMBOL-DBIND 0 1 0)
(ADD-HASH 'SYMBOL-DBIND '((SYMBOL) T)
'((CSTR (*) *) (EL (*) *)
(CHECK-TYPE-SYMBOL (T T T *) T) (SYMBOLP (T) T)
(TYPEP (T T *) BOOLEAN))COMPILER.,DECLAR,OPTIMIZ.,SAFETY.
.
s_dbind.
'/tmp/gazonk_12559_0.lsp))
(DO-RECOMPILE)))))
static object LI1__SYMBOL_DBIND___gazonk_12559_0();
#define VMB1
#define VMS1
#define VMV1
#define VMR1(VMT1) return(VMT1);
#define VM1 0
static void * VVi[5]={
#define Cdata VV[4]
(void *)(LI1__SYMBOL_DBIND___gazonk_12559_0)
};
#define VV (VVi)
static object LnkTLI3(object,...);
static object (*LnkLI3)() = (object (*)()) LnkTLI3;
NIL
>(disassemble '(lamdda (x) (c::symbol-dbind x)) nil)
Not a lambda or a name
NIL
>(disassemble '(lamda (x) (c::symbol-dbind x)) nil)
Not a lambda or a name
NIL
>(disassemble '(lambda (x) (c::symbol-dbind x)) nil)
;; Compiling /tmp/gazonk_12559_0.lsp.
;; End of Pass 1.
;; End of Pass 2.
;; OPTIMIZE levels: Safety=0 (No runtime error checking), Space=0, Speed=3,
(Debug quality ignored)
;; Finished compiling /tmp/gazonk_12559_0.o.
#include "gazonk_12559_0.h"
void init_code(){do_init((void *)VV);}
/* local entry for function COMPILER::CMP-ANON */
static object LI1__CMP_ANON___gazonk_12559_0(V2)
object V2;
{ VMB1 VMS1 VMV1
goto TTL;
TTL:;
/*(SYMBOL-DBIND X)*/
{object V3;
V3= (V2);
{object V4 = (((V3))->s.s_dbind);VMR1
(V4);}}
/* END (SYMBOL-DBIND X)*/
return Cnil;
}
#(#(OBJECT
(%INIT
. #((LET ((*DISABLE-RECOMPILE* T))
(MFSFUN 'CMP-ANON 0 1 0)
(ADD-HASH 'CMP-ANON '((T) T) '((SYMBOL-DBIND (SYMBOL) T))
.COMMON-LISP-USER
CSYMBOL-DBIND-.
'/tmp/gazonk_12559_0.lsp))
(DO-RECOMPILE)))))
static object LI1__CMP_ANON___gazonk_12559_0();
#define VMB1
#define VMS1
#define VMV1
#define VMR1(VMT1) return(VMT1);
#define VM1 0
static void * VVi[2]={
#define Cdata VV[1]
(void *)(LI1__CMP_ANON___gazonk_12559_0)
};
#define VV (VVi)
NIL
>(si::sig 'c::string-fillp)
(((ARRAY CHARACTER (*))) (INTEGER 0 268435455))
These should propagate limited integer types from the appropriate
number of bits in the structure definition. The relevant file that
does this is lsp/gcl_cp.lsp.
I'll be out of the country for 10 days. I'd love any feedback or
suggestions when I return.
Take care,
--
Camm Maguire address@hidden
==========================================================================
"The earth is but one country, and mankind its citizens." -- Baha'u'llah
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gcl-devel] The "C" package,
Camm Maguire <=