newLISP Fan Club

Forum => newLISP newS => Topic started by: Dmi on May 22, 2007, 11:40:29 PM

Title: global? check
Post by: Dmi on May 22, 2007, 11:40:29 PM
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)))
Title:
Post by: Lutz on May 23, 2007, 12:57:13 AM
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
Title:
Post by: Dmi on May 23, 2007, 12:59:26 AM
Thanks!!!!
Title:
Post by: Fanda on May 23, 2007, 10:07:22 AM
Maybe, we could add 'global?' to the newLISP core.



Fanda