Changeset 37621 in project


Ignore:
Timestamp:
05/31/19 21:20:26 (3 months ago)
Author:
Kon Lovett
Message:

fix stack structure tag w/ exporting module, bump version, simpler csc test options

Location:
release/5/stack/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • release/5/stack/trunk/stack.egg

    r36054 r37621  
    33
    44((synopsis "Provides LIFO queue (stack) operations")
    5  (version "3.0.1")
     5 (version "3.0.2")
    66 (category data)
    77 (author "[[kon lovett]]")
  • release/5/stack/trunk/stack.scm

    r35980 r37621  
    1717
    1818(;export
     19  ;stack
    1920  make-stack
    2021  list->stack
     
    2930  stack-cut!
    3031  stack-pop!
    31   stack-map
    3232  stack-map
    3333  stack-for-each
     
    6161|#
    6262
     63;; Stack Type
     64
     65(define-type stack (struct stack#stack))
     66
     67(define-constant stack 'stack#stack)
     68;(define stack 'stack#stack)
     69
    6370;; Stack Support
    6471
    6572(define-inline (%make-stack)
    66         (%make-structure 'stack '() 0) )
     73        (%make-structure stack '() 0) )
    6774
    6875(define-inline (%stack? obj)
    69         (%structure-instance? obj 'stack) )
     76        (%structure-instance? obj stack) )
    7077
    7178(define-inline (%valid-stack? obj)
     
    163170;;;
    164171
    165 (: make-stack (-> (struct stack)))
     172(define stack )
     173
     174(: make-stack (-> stack))
    166175;
    167176(define (make-stack)
    168177  (%make-stack) )
    169178
    170 (: list->stack (list -> (struct stack)))
     179(: list->stack (list -> stack))
    171180;
    172181(define (list->stack ls)
     
    181190(define (stack? obj) (%stack? obj))
    182191
    183 (: stack-empty? ((struct stack) -> boolean))
     192(: stack-empty? (stack -> boolean))
    184193;
    185194(define (stack-empty? stk)
    186195        (%stack-empty? (%check-stack 'stack-empty? stk)) )
    187196
    188 (: stack-count ((struct stack) -> fixnum))
     197(: stack-count (stack -> fixnum))
    189198;
    190199(define (stack-count stk)
    191200        (%stack-count (%check-stack 'stack-count stk)) )
    192201
    193 (: stack-peek ((struct stack) #!optional fixnum -> *))
     202(: stack-peek (stack #!optional fixnum -> *))
    194203;
    195204(define (stack-peek stk #!optional (idx 0))
    196205        (%car (%stack-node-ref 'stack-peek (%check-stack 'stack-peek stk) idx)) )
    197206
    198 (: stack-empty! ((struct stack) -> undefined))
     207(: stack-empty! (stack -> void))
    199208;
    200209(define (stack-empty! stk)
    201210        (%stack-empty! (%check-stack 'stack-empty! stk)) )
    202211
    203 (: stack-poke! ((struct stack) * #!optional fixnum -> undefined))
     212(: stack-poke! (stack * #!optional fixnum -> void))
    204213;
    205214(define (stack-poke! stk obj #!optional (idx 0))
    206215        (%set-car!/mutate (%stack-node-ref 'stack-poke! (%check-stack 'stack-poke! stk) idx) obj) )
    207216
    208 (: stack-push! ((struct stack) #!rest * -> undefined))
     217(: stack-push! (stack #!rest * -> void))
    209218;
    210219(define (stack-push! stk #!rest ls)
    211220        (unless (%null? ls) (%stack-push! (%check-stack 'stack-push! stk) ls)) )
    212221
    213 (: stack-cut! ((struct stack) fixnum #!optional fixnum -> list))
     222(: stack-cut! (stack fixnum #!optional fixnum -> list))
    214223;
    215224(define (stack-cut! stk start #!optional (end (%stack-count stk)))
     
    238247        ls ) ) ) )
    239248
    240 (: stack-pop! ((struct stack) -> *))
     249(: stack-pop! (stack -> *))
    241250;
    242251(define (stack-pop! stk)
     
    245254        (%stack-pop! stk) )
    246255
    247 (: stack->list ((struct stack) -> list))
     256(: stack->list (stack -> list))
    248257;
    249258(define (stack->list stk)
    250259        (%list-copy (%stack-list (%check-stack 'stack->list stk))) )
    251260
    252 (: stack-fold ((struct stack) procedure * -> *))
     261(: stack-fold (stack procedure * -> *))
    253262;
    254263(define (stack-fold stk func init)
    255264        (%list-fold/1 func init (%stack-list (%check-stack 'stack-fold stk))) )
    256265
    257 (: stack-map ((struct stack) procedure -> list))
     266(: stack-map (stack procedure -> list))
    258267;
    259268(define (stack-map stk func)
    260269        (%list-map/1 func (%stack-list (%check-stack 'stack-map stk))) )
    261270
    262 (: stack-for-each ((struct stack) procedure -> undefined))
     271(: stack-for-each (stack procedure -> void))
    263272;
    264273(define (stack-for-each stk proc)
  • release/5/stack/trunk/tests/run.scm

    r35980 r37621  
    1313
    1414;no -disable-interrupts
    15 (define *csc-options* "-inline-global \
     15#;(define *csc-options* "-inline-global \
    1616  -specialize -optimize-leaf-routines -clustering -lfa2 \
    1717  -local -inline \
    18   -no-trace -no-lambda-info \
    19   -unsafe")
     18  -no-trace -no-lambda-info")
     19(define *csc-options* "-O3 -d1 -local")
    2020
    2121(define (test-name #!optional (eggnam EGG-NAME))
Note: See TracChangeset for help on using the changeset viewer.