SORU
16 NİSAN 2009, PERŞEMBE


Emacs Lisp, nasıl eğer bir değişken tanımlı ise kontrol edebilirim?

Emacs Lisp, nasıl eğer bir değişken tanımlı ise kontrol edebilirim?

CEVAP
16 NİSAN 2009, PERŞEMBE


boundp isteyebilirsiniz: dönerse değişken (sembolü) ise onun geçerli ve bağlayıcı geçersiz ise; daha doğrusu boşluk ise yok. Aksi takdirde sıfır döner.

  (boundp 'abracadabra)          ; Starts out void.
  => nil

  (let ((abracadabra 5))         ; Locally bind it.
    (boundp 'abracadabra))
  => t

  (boundp 'abracadabra)          ; Still globally void.
  => nil

  (setq abracadabra 5)           ; Make it globally nonvoid.
  => 5

  (boundp 'abracadabra)
  => t

Bunu Paylaş:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • Cole Rolland

    Cole Rolland

    23 Kasım 2008
  • Philip DeFranco

    Philip DeFra

    16 EYLÜL 2006
  • Strata1000

    Strata1000

    28 EYLÜL 2009