2008年6月16日

PICK is not picky

PICK可能是最不挑剔的(picky)REBOL函數,它接受的第一個參數可以是35種資料型別:

series! gob! pair! event! money! date! time! object! port! tuple ! bitset! any-function!

只有12個?別忘了,其中series!和any-function!是typeset!,將它們兩個展開之後變成

string! binary! file! email! url! tag! issue! bitset! vector! image! block! paren! map! path! set-path! get-path! lit-path! gob! pair! event! money! date! time! object! port! tuple ! bitset! native! action! routine! rebcode! op! closure! function!

共有35個資料型別。其中any-function!和object應該已經可以利用reflect(以及相關函數)取代,只是目前REBOL 3.0尚未禁止使用REBOL 2.x的pick、first等函數進行reflect。

另外有兩個可疑的資料型別,分別是event!與money!,我認為PICK不應該用來處理它們。我已經報告到Bug資料庫了。

沒有留言: