global? check

Started by Dmi, May 22, 2007, 11:40:29 PM

Previous topic - Next topic

Dmi

Hi, Lutz!



The function, you suggested eraly isn't working anymore and always returns nil.
(define (global? s)
  "(global? 'sym) - return 'sym if it is global, otherwise - nil"
  (let (mask (if (= (pack "d" 1) "0001") 0x02000000 0x00000200))
    (= (& (get-int (last (dump s))) mask) mask)))
WBR, Dmi

Lutz

#1
The global bit has moved, this corrected version works:


(define (global? s)
     (let (mask (if (= (pack "d" 1) "0001")
                        0x00200000 0x00000020))
          (= (& (get-int (last (dump s))) mask) mask)))


(global? 'x) => nil)

(global 'x)

(global? 'x) => true)


Lutz

Dmi

#2
Thanks!!!!
WBR, Dmi

Fanda

#3
Maybe, we could add 'global?' to the newLISP core.



Fanda