Minor alien fixes

slava 2006-05-19 19:53:30 +00:00
parent c1803e1a4e
commit e76ba67cbf
4 changed files with 26 additions and 23 deletions

View File

@ -1,12 +1,8 @@
- remove F_USERENV rel
- method ordering and interpreter algorithm sections need updates
- update walker for new interpreter
- quotations should store their originating word
- core foundation should use unicode strings
- alien>utf16-string, utf16-string>alien words
- can <void*> only be called with an alien?
- remove <char*>, <ushort*>, set-char*-nth, set-ushort*-nth since they
have incorrect semantics
- fix compiled gc check
- 3 >n fep
- code walker & exceptions
@ -22,6 +18,19 @@
- yield in a loop starves i/o
- "localhost" 50 <client> won't fail
+ help:
- method ordering and interpreter algorithm sections need updates
- document that can <void*> only be called with an alien
- help search
- fix remaining HTML stream issues
- automatically update help graph when adding/removing articles/words
- document conventions
- new turtle graphics tutorial
- better line spacing in ui and html
- tabular formatting - for inspector, changes and $values in help
- grid layout
+ ui/help:
- implement handlers for open, quit events, and whatever else
@ -33,7 +42,6 @@
- speed up ideas:
- only do clipping for certain gadgets
- use glRect
- help search
- reimplement tab completion
- x11 input methods
- x11 title bars are funny
@ -45,14 +53,7 @@
- saving the image should save window configuration
- make the UI look better, something like this:
http://twb.ath.cx/~twb/darcs/OBSOLETE/factor/final.html
- fix remaining HTML stream issues
- fix up the min thumb size hack
- automatically update help graph when adding/removing articles/words
- document conventions
- new turtle graphics tutorial
- better line spacing in ui and html
- tabular formatting - for inspector, changes and $values in help
- grid layout
- variable width word wrap
+ compiler/ffi:

View File

@ -7,8 +7,6 @@ parser sequences strings words ;
: <c-type> ( -- type )
H{
{ "setter" [ "Cannot read struct fields with type" throw ] }
{ "getter" [ "Cannot write struct fields with type" throw ] }
{ "boxer" [ "boxer-function" get %box ] }
{ "unboxer" [ "unboxer-function" get %unbox ] }
{ "reg-class" T{ int-regs f } }
@ -77,8 +75,7 @@ SYMBOL: c-types
[ define-c-type ] keep "alien"
2dup init-c-type
2dup define-deref
2dup define-set-nth
define-out ;
over c-setter [ 2dup define-set-nth define-out ] when ;
: typedef ( old new -- )
over "*" append over "*" append (typedef) (typedef) ;

View File

@ -103,10 +103,6 @@ USING: alien compiler kernel kernel-internals math namespaces ;
[
[ alien-unsigned-cell <alien> alien>string ] "getter" set
[
>r >r string>alien alien-address r> r>
set-alien-unsigned-cell
] "setter" set
bootstrap-cell "width" set
bootstrap-cell "align" set
"box_c_string" "boxer-function" set
@ -115,7 +111,6 @@ USING: alien compiler kernel kernel-internals math namespaces ;
[
[ alien-unsigned-4 ] "getter" set
[ set-alien-unsigned-4 ] "setter" set
bootstrap-cell "width" set
bootstrap-cell "align" set
"box_utf16_string" "boxer-function" set

View File

@ -7,15 +7,25 @@ sequences strings words ;
! Some code for interfacing with C structures.
: c-getter* ( name -- quot )
c-getter [
[ "Cannot read struct fields with type" throw ]
] unless* ;
: define-getter ( offset type name -- )
#! Define a word with stack effect ( alien -- obj ) in the
#! current 'in' vocabulary.
create-in >r c-getter swap add* r> swap define-compound ;
create-in >r c-getter* swap add* r> swap define-compound ;
: c-setter* ( name -- quot )
c-setter [
[ "Cannot write struct fields with type" throw ]
] unless* ;
: define-setter ( offset type name -- )
#! Define a word with stack effect ( obj alien -- ) in the
#! current 'in' vocabulary.
"set-" swap append create-in >r c-setter swap add* r>
"set-" swap append create-in >r c-setter* swap add* r>
swap define-compound ;
: define-field ( offset type name -- offset )