home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / historic / v941.tgz / icon.v941src.tar / icon.v941src / tests / general / evalx.std < prev    next >
Text File  |  2001-05-02  |  4KB  |  305 lines

  1.  ----> &null
  2. 2 === +2 ----> 2
  3. 3 === *"abc" ----> 3
  4. 'abc' === ('abc' ++ '') ----> 'abc'
  5. 'a' ----> 'a'
  6. 'ab' ----> 'ab'
  7. '\xb9' ----> '\xb9'
  8. '\xb8\xb4' ----> '\xb4\xb8'
  9. '\^d' ----> '\x04'
  10. '\^a\^d' ----> '\x01\x04'
  11. "a" ----> "a"
  12. "ab" ----> "ab"
  13. "\xb9" ----> "\xb9"
  14. "\xb8\xb4" ----> "\xb8\xb4"
  15. "\^d" ----> "\x04"
  16. "\^a\^d" ----> "\x01\x04"
  17. *'a' ----> 1
  18. *'ab' ----> 2
  19. *'\xb9' ----> 1
  20. *'\xb8\xb4' ----> 2
  21. *'\^d' ----> 1
  22. *'\^a\^d' ----> 2
  23. *"a" ----> 1
  24. *"ab" ----> 2
  25. *"\xb9" ----> 1
  26. *"\xb8\xb4" ----> 2
  27. *"\^d" ----> 1
  28. "*\^a\^d" ----> "*\x01\x04"
  29. 1
  30. 3
  31. 5
  32. 7
  33. 9
  34. every write("..."(1,10,2)) ----> none
  35. function write
  36. every write("image"(write)) ----> none
  37. "[:]"("abcdef",3,5) ----> "cd"
  38. "[]"(&lcase,3) ----> "c"
  39. image(proc("^",1)) ----> "function ^"
  40. image(proc("^",2)) ----> "function ^"
  41. proc("+",2)(3,4) ----> 7
  42. proc(proc)("write") ----> function write
  43. proc("+") ----> function +
  44. ?10 ----> 3
  45. ?10 ----> 5
  46. ?10 ----> 4
  47. ?20 ----> 11
  48. ?[1,2,3,4] ----> 2
  49. ?[1,2,3,4] ----> 2
  50. x := array(1,2,3,4,5,6,7) ----> record array_1(7)
  51. ?x ----> 1
  52. ?x ----> 6
  53. ?x ----> 1
  54. ?x ----> 6
  55. ?x ----> 1
  56. ?x ----> 3
  57. ?x ----> 4
  58. ?x ----> 5
  59. 6
  60. 8
  61. 8
  62. 3
  63. 9
  64. 4
  65. 4
  66. 9
  67. 9
  68. 1
  69. every 1 to 10 do write(?10) ----> none
  70. 8
  71. 4
  72. 7
  73. 5
  74. 9
  75. 10
  76. 4
  77. 5
  78. 6
  79. 7
  80. every 1 to 10 do write(?[1,2,3,4,5,6,7,8,9,10]) ----> none
  81. a
  82. f
  83. c
  84. c
  85. a
  86. f
  87. d
  88. d
  89. f
  90. b
  91. every 1 to 10 do write(?"abcdef") ----> none
  92. x := array(1,2,3,4,5,6,7) ----> record array_2(7)
  93. 3
  94. 6
  95. 7
  96. 7
  97. 4
  98. 6
  99. 4
  100. 1
  101. 6
  102. 6
  103. every 1 to 10 do write(?x) ----> none
  104. (1,2,3,4,5) ----> 5
  105. 1
  106. 2
  107. 3
  108. 4
  109. 5
  110. every write((1 to 5)(1,2,3,4,5)) ----> none
  111. 0(1,2) ----> none
  112. 1(1) ----> 1
  113. 2(1) ----> none
  114. (-1)(1,2,3) ----> 3
  115. 3(1,2,3,&fail) ----> none
  116. a
  117. a
  118. b
  119. b
  120. c
  121. c
  122. a
  123. a
  124. b
  125. b
  126. c
  127. c
  128. a
  129. a
  130. b
  131. b
  132. c
  133. c
  134. a
  135. a
  136. b
  137. b
  138. c
  139. c
  140. a
  141. a
  142. b
  143. b
  144. c
  145. c
  146. every write(2(1 to 5,!"abc",1 to 2)) ----> none
  147. x := 1 ----> 1
  148. y := 2 ----> 2
  149. (x := y) & &fail ----> none
  150. a
  151. b
  152. c
  153. d
  154. e
  155. f
  156. every write(!"abcdef") ----> none
  157. 1
  158. 2
  159. 3
  160. 4
  161. 5
  162. every write(![1,2,3,4,5]) ----> none
  163. 1
  164. 2
  165. 3
  166. 4
  167. 5
  168. every write(!![1,2,3,4,5]) ----> none
  169. 1
  170. a
  171. b
  172. 1
  173. 2
  174. 3
  175. 3
  176. 4
  177. every write(!![1,"ab",[1,2,3],34]) ----> none
  178. 1
  179. a
  180. b
  181. 1
  182. 2
  183. 3
  184. 3
  185. 4
  186. every write(!([1,"ab",[1,2,3],34][1 to 4])) ----> none
  187. x := array(1,2,3,4,5) ----> record array_3(7)
  188. 1
  189. 2
  190. 3
  191. 4
  192. 5
  193.  
  194.  
  195. every write(!x) ----> none
  196. x := 1 ----> 1
  197. y := 2 ----> 2
  198. x <-> y ----> 2
  199. y <-> x ----> 2
  200. (x <-> y) & &fail ----> none
  201. x ----> 1
  202. y ----> 2
  203. *"" ----> 0
  204. *'' ----> 0
  205. *[] ----> 0
  206. *table() ----> 0
  207. *30 ----> 2
  208. !"abc" ----> "a"
  209. ![1,2,3] ----> 1
  210. !&lcase ----> "a"
  211. !30 ----> "3"
  212. !table() ----> none
  213. ?"abc" ----> "c"
  214. ?&lcase ----> "f"
  215. ?[1,2,3] ----> 2
  216. ?table() ----> none
  217. ?30 ----> 27
  218. .x ----> &null
  219. ."abc" ----> "abc"
  220. .[] ----> list_22(0)
  221. .main ----> procedure main
  222. /main ----> none
  223. /"abc" ----> none
  224. /&null ----> &null
  225. /[] ----> none
  226. /&lcase ----> none
  227. \main ----> procedure main
  228. \"abc" ----> "abc"
  229. \x ----> none
  230. \[] ----> list_24(0)
  231. \&null ----> none
  232. 1 | 2 | 3 ----> 1
  233. |(1 to 10) ----> 1
  234. ||(1 to 10) ----> 1
  235. |||(1 to 10) ----> 1
  236. ||||(1 to 10) ----> 1
  237. |||||(1 to 10) ----> 1
  238. |||||||(1 to 10) ----> 1
  239. 2 \ 2 ----> 2
  240. while 1 do break ----> &null
  241. while 1 do break "hello" ----> "hello"
  242. while break ----> &null
  243. case 1 of {2:3; "1":4; 1: 4 to 10; default: "whoa"} ----> 4
  244. not 1 ----> none
  245. not \&null ----> &null
  246. repeat break ----> &null
  247. until 1 do 2 ----> none
  248. if 1 then 2 else 3 ----> 2
  249. 1
  250. 2
  251. 3
  252. 4
  253. 5
  254. 6
  255. 7
  256. 8
  257. 9
  258. 10
  259. every write(if 1 then 1 to 10 else 5) ----> none
  260. 10
  261. 9
  262. 8
  263. 7
  264. 6
  265. 5
  266. 4
  267. 3
  268. 2
  269. 1
  270. every write(if 1 = 0 then 1 to 10 else 10 to 1 by -1) ----> none
  271. if 1 then 2 ----> 2
  272. if 1 = 0 then 2 ----> none
  273. x := 1 ----> 1
  274. y := 2 ----> 2
  275. z := 3 ----> 3
  276. x :=: y ----> 2
  277. y :=: x ----> &null
  278. x ----> &null
  279. y ----> &null
  280. z ----> &null
  281. x :=: y :=: z ----> &null
  282. x ----> &null
  283. y ----> &null
  284. z ----> &null
  285. x := 1 ----> 1
  286. y := 2 ----> 2
  287. z := 3 ----> 3
  288. x <-> y ----> &null
  289. y <-> x ----> &null
  290. x ----> &null
  291. y ----> &null
  292. z ----> &null
  293. x <-> y :=: z ----> &null
  294. x ----> &null
  295. y ----> &null
  296. z ----> &null
  297. 1 & 2 & 3 & 4 ----> 4
  298. (1 & 2 & 3 & x) := 3 ----> 3
  299. x ----> &null
  300. x := 1 ----> 1
  301. y := 2 ----> 2
  302. (x <- y) & &fail ----> none
  303. x ----> 1
  304. y ----> 2
  305.