Nп/п : 73 из 93
 От   : none) (albert                       2:5075/128        09 сен 23 22:47:16
 К    : All                                                   09 сен 23 23:50:01
 Тема : clojure / MAL confusion about true.
----------------------------------------------------------------------------------
                                                                                 
@MSGID:
dfbccd10
@REPLYADDR none) (albert
@REPLYTO 2:5075/128 none) (albert
@CHRS: CP866 2
@RFC: 1 0
@RFC-Message-ID:

@TZUTC: 0200
@TID: FIDOGATE-5.12-ge4e8b94
I`m working with MAL that is supposed to be a Clojure clone.
I`m surprised to see the following.
Almost nothing is consider false in the second position
in the `if construct, however asking for a truth value explicitly
by `true? is different. (Naively I borrowed the code for if,
routinely isolated in a separate function, and used this for `true? ).
Testing failed, thus I checked with the Clojure installed on my system.

"
  Clojure 1.10.1
  user=> (true? true)
  true
  user=> (if true? 1 2)
  1
  user=> (true? true?)
  false
"

Is there a reason for this?

Groetjes Albert
-- 
Don`t praise the day before the evening. One swallow doesn`t make spring.
You must not say "hey" before you have crossed the bridge. Don`t sell the
hide of the bear until you shot it. Better one bird in the hand than ten in
the air. First gain is a cat spinning.            - the Wise from Antrim -
--- trn 4.0-test77 (Sep 1, 2010)
 * Origin: KPN B.V. (2:5075/128)
SEEN-BY: 5001/100 5005/49 5015/255 5019/40 5020/715
848 1042 4441 12000
SEEN-BY: 5030/49 1081 5058/104 5075/128
@PATH: 5075/128 5020/1042 4441



   GoldED+ VK   │                                                 │   09:55:30    
                                                                                
В этой области больше нет сообщений.

Остаться здесь
Перейти к списку сообщений
Перейти к списку эх