Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Words

From: gabriele:colellachiara at: 12-May-2006 10:23

Hello all, Given: check: func [n m] [ print ["Considering" block/:n "and" block/:m "(positions" n "and" m "in the block):"] either same? block/:n block/:m [ print "they are the same word" ] [ either equal? block/:n block/:m [ print "they are not the same word, but they are equal" ] [ print "they are not equal" ] ] ] we have:
>> alias 'aaa "bbb"
== bbb
>> block: [aaa bbb aaa Aaa]
== [aaa bbb aaa Aaa]
>> append block use [aaa] ['aaa]
== [aaa bbb aaa Aaa aaa]
>> check 1 2
Considering aaa and bbb (positions 1 and 2 in the block): they are not the same word, but they are equal
>> check 1 3
Considering aaa and aaa (positions 1 and 3 in the block): they are the same word
>> check 1 4
Considering aaa and Aaa (positions 1 and 4 in the block): they are not equal
>> check 1 5
Considering aaa and aaa (positions 1 and 5 in the block): they are not the same word, but they are equal
>> check 2 4
Considering bbb and Aaa (positions 2 and 4 in the block): they are not equal Regards, Gabriele. -- Gabriele Santilli <gabriele-rebol.com> --- http://www.rebol.com/ Colella Chiara software division --- http://www.colellachiara.com/