Nife version Beta
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

654 lines
29 KiB

  1. " { -- string }
  2. begins a string wich is terminated by itself. The first blank is a separator.
  3. The character \ masks the character " as end of string.
  4. ' : { string -- }
  5. begins, into a function (beetween : and ;), a string which represents a name of
  6. a user function, or a variable. This string will be interpreted and executed
  7. during the function execution.
  8. There is no verification : if the name does not exist, it does nothing.
  9. ` : { string -- }
  10. begins, into a function (beetween : and ;), a string which represents a name of
  11. a user function, or a variable. This string will be interpreted and executed
  12. during the function execution. At the first time the code is updated if the
  13. function or the variable is found.
  14. There is no verification : if the name does not exist, it does nothing.
  15. "cat : { str1 str2 -- 'str1str2' }
  16. catenates the two elements on the top string stack entry.
  17. "cats : { str1 str2 -- 'str1 str2' }
  18. catenates the two elements on the top string stack entry with a space beetween.
  19. "date : { -- date_string }
  20. puts the date string (JJ/MM/AAAA) on the top string stack entry.
  21. "drop : { str1 -- }
  22. removes the top string stack entry.
  23. "dup : { str1 -- str1 str1 }
  24. duplicates the top string stack entry.
  25. "over : { str2 str1 -- str2 str1 str2 }
  26. duplicates the second string stack entry onto the top of the stack.
  27. "swap : { str2 str1 -- str1 str2 }
  28. exchanges the top two string stack entries.
  29. "time : { -- time_string }
  30. put the time string (hh:mm:ss) on the top string stack entry.
  31. "type : { str1 -- }
  32. displays and removes the top string stack entry.
  33. "f : { fname -- }
  34. executes the function fname. An error occurs if the function does not exist.
  35. "v : { vname -- }
  36. executes the variable vname. An error occurs if the variable does not exist.
  37. "f? : { fname -- } ( -- T/F )
  38. executes the function fname. In succes TRUE is putting on the logical stack, if
  39. not FALSE.
  40. "v? : { vname -- } ( -- T/F )
  41. executes the variable vname. In succes TRUE is putting on the logical stack, if
  42. not FALSE.
  43. "exec : { "code" -- }
  44. executes the code in a string on the top of the character stack.
  45. Does nothing if the string is empty.
  46. "execf : { "code" -- }
  47. executes the code in a string on the top of the character stack as the content
  48. of a function. At each time the function is dynamicaly compiled and executed.
  49. Does nothing if the string is empty.
  50. "execk : { "code" -- }
  51. compiles the code in a string on the top of the character stack as the content
  52. of a function. At the first time the function is dynamicaly compiled, keep as
  53. a user function and executed. On other times the string is removed and the user
  54. function is simply executed.
  55. Does nothing if the string is empty.
  56. * : [ e1 e2 -- result ]
  57. calculates the multiplication : e1 * e2.
  58. If e1 and e2 are arrays, they must have the same dimension and the result will
  59. be an array of this dimension with result[i] = e1[i] * e2[i].
  60. If e1 or e2 is an array the function adapts itself.
  61. As this operation is commutative the result will be the same if the array is in
  62. first or second position.
  63. ** : [ e1 e2 -- result ]
  64. calculates the power : e1 ** e2.
  65. If e1 and e2 are arrays, they must have the same dimension and the result will
  66. be an array of this dimension with result[i] = e1[i] ** e2[i].
  67. If e1 or e2 is an array the function adapts itself.
  68. WARNING : As this operation is NOT commutative the result will NOT be the same
  69. if the array is in first or second position.
  70. *[]< : [ tab1 tab2 ... tabn n -- tab1 tab2 ... tabn ]
  71. left shift n arrays. The same as []< with n tabs.
  72. *[]<< : [ tab1 tab2 ... tabn n i -- tab1 tab2 ... tabn ]
  73. left shift of i elements on n array. The same as []<< with n tabs.
  74. *[]> : [ tab1 tab2 ... tabn n -- tab1 tab2 ... tabn ]
  75. right shift n arrays. The same as []> with n tabs.
  76. *[]>> : [ tab1 tab2 ... tabn n i -- tab1 tab2 ... tabn ]
  77. right shift of i elements on n array. The same as []>> with n tabs.
  78. *[]rev : [ tab1 tab2 ... tabn n -- tab1 tab2 ... tabn ]
  79. reverse n arrays. The same as []rev with n tabs.
  80. *drop : [ En+1 En ... E1 n -- En+1 ]
  81. removes the top n number stack entries from the stack.
  82. *dup : [ En ... E1 n -- En ... E1 En ... E1 ]
  83. duplicates the top n entries on the number stack.
  84. + : [ e1 e2 -- result ]
  85. calculates the addition : e1 + e2.
  86. If e1 and e2 are arrays, they must have the same dimension and the result will
  87. be an array of this dimension with result[i] = e1[i] + e2[i].
  88. If e1 or e2 is an array the function adapts itself.
  89. As this operation is commutative the result will be the same if the array is in
  90. first or second position.
  91. - : [ e1 e2 -- result ]
  92. calculates the soustraction : e1 - e2.
  93. If e1 and e2 are arrays, they must have the same dimension and the result will
  94. be an array of this dimension with result[i] = e1[i] - e2[i].
  95. If e1 or e2 is an array the function adapts itself.
  96. WARNING : As this operation is NOT commutative the result will NOT be the same
  97. if the array is in first or second position.
  98. . : [ e -- ]
  99. displays and removes the top number stack entry.
  100. / : [ e1 e2 -- result ]
  101. calculates the division : e1 / e2.
  102. If e1 and e2 are arrays, they must have the same dimension and the result will
  103. be an array of this dimension with result[i] = e1[i] / e2[i].
  104. If e1 or e2 is an array the function adapts itself.
  105. WARNING : As this operation is NOT commutative the result will NOT be the same
  106. if the array is in first or second position.
  107. < : [ e1 e2 -- ] ( -- bool )
  108. evaluates the less than test and put the result, true or false, on the logical
  109. stack.
  110. If e1 and e2 are arrays, they must have the same dimension and the result will
  111. be a AND of the comparison of each elements : e1[i] < e2[i].
  112. If e1 or e2 is an array the function adapts itself.
  113. WARNING : As this operation is NOT commutative the result will NOT be the same
  114. if the array is in first or second position.
  115. <= : [ e1 e2 -- ] ( -- bool )
  116. evaluates the less or equal than test and put the result, true or false, on the
  117. logical stack.
  118. If e1 and e2 are arrays, they must have the same dimension and the result will
  119. be a AND of the comparison of each elements : e1[i] < e2[i].
  120. If e1 or e2 is an array the function adapts itself.
  121. WARNING : As this operation is NOT commutative the result will NOT be the same
  122. if the array is in first or second position.
  123. <> : [ e1 e2 -- ] ( -- bool )
  124. evaluates the not equal test and put the result, true or false, on the logical
  125. stack.
  126. If e1 and e2 are arrays, they must have the same dimension and the result will
  127. be a AND of the comparison of each elements : e1[i] < e2[i].
  128. If e1 or e2 is an array the function adapts itself.
  129. WARNING : As this operation is NOT commutative the result will NOT be the same
  130. if the array is in first or second position.
  131. = : [ e1 e2 -- ] ( -- bool )
  132. evaluates the equal test and put the result on the logical stack.
  133. If e1 and e2 are arrays, they must have the same dimension and the result will
  134. be a AND of the comparison of each elements : e1[i] < e2[i].
  135. If e1 or e2 is an array the function adapts itself.
  136. As this operation is commutative the result will be the same if the array is in
  137. first or second position.
  138. > : [ e1 e2 -- ] ( -- bool )
  139. evaluates the greater than test and put the result on the logical stack.
  140. If e1 and e2 are arrays, they must have the same dimension and the result will
  141. be a AND of the comparison of each elements : e1[i] < e2[i].
  142. If e1 or e2 is an array the function adapts itself.
  143. WARNING : As this operation is NOT commutative the result will NOT be the same
  144. if the array is in first or second position.
  145. >-scalar : [ [v1, ... ,vn] -- vn ... v2 v1 ]
  146. transforms the array, on the top of the stack, with n elements, in n scalars.
  147. The first value of the array will be the scalar on the top.
  148. >= : [ e1 e2 -- ] ( -- bool )
  149. evaluates the greater or equal than test and put the result, true or false, on
  150. the logical stack.
  151. If e1 and e2 are arrays, they must have the same dimension and the result will
  152. be a AND of the comparison of each elements : e1[i] < e2[i].
  153. If e1 or e2 is an array the function adapts itself.
  154. WARNING : As this operation is NOT commutative the result will NOT be the same
  155. if the array is in first or second position.
  156. >array : [ e1 e2 .... eN n -- array ]
  157. take n elements to make an array. Each element ei may be an array.
  158. >scalar : [ [v1, ... ,vn] -- v1 v2 ... vn ]
  159. transforms the array, on the top of the stack, with n elements, in n scalars.
  160. The last value of the array will be the scalar on the top.
  161. ?cs :
  162. displays the character (string) stack.
  163. ?drop : ( bool1 -- )
  164. removes the top logical stack entry.
  165. ?dup : ( bool1 -- bool1 bool1 )
  166. duplicates the top logical stack entry.
  167. ?lib :
  168. displays the names of base library functions.
  169. ?libD :
  170. displays the names of devices library functions.
  171. ?libN :
  172. displays the names of network library functions.
  173. ?libT :
  174. displays the names of tools library functions. Theses tools are built on extern
  175. Linux tools (gnuplot, xgraph, ...).
  176. ?libM :
  177. displays the names of math library functions.
  178. ?libP :
  179. displays the names of programming library functions.
  180. ?libU :
  181. displays the names of user system functions.
  182. ?libs :
  183. displays the names of all libraries functions.
  184. ?ls :
  185. displays the logical stack.
  186. ?over : ( bool2 bool1 -- bool2 bool1 bool2 )
  187. duplicates the second logical stack entry onto the top of the stack.
  188. ?s :
  189. display the number stack.
  190. ?swap : ( bool2 bool1 -- bool1 bool2 )
  191. exchanges the top two logical stack entries.
  192. ?t/f : ( bool -- )
  193. displays and removes the top logical stack entry.
  194. ?vars :
  195. display the list of constants of the system environment.
  196. DEBUG_I/O :
  197. toggle to set debug mode on or off.
  198. INTEGER :
  199. sets the default type to INTEGER.
  200. NBLIG : [ n -- ]
  201. sets the variable NBLIG to n.
  202. NBLIG is used to limit the display of the stack.
  203. NBTAB : [ n -- ]
  204. sets the variable NBTAB to n.
  205. NBTAB is used to limit the display of the stack.
  206. REAL :
  207. sets the default type to REAL.
  208. []< : [ [v1,v2,...vn] -- [v2, ... ,vn,v1] ]
  209. left shift of 1 element on an array.
  210. []<< : [ [v1,v2,...vn] i -- [vi+1, ... ,vn,v1,v2 ... vi] ]
  211. left shift of i elements on an array.
  212. []> : [ [v1,v2,...vn] -- [vn,v1,v2, ... ,vn-1] ]
  213. right shift of 1 element on an array.
  214. []>> : [ [vn,vn-1,...,v2,v1] i -- [vi, ... ,v2,v1,vn ... vi+1] ]
  215. right shift of i elements on an array.
  216. []crot : [ tab1 tab2 ... tabN n -- Ntab1 ... NtabP ]
  217. clock rotation on n arrays of P elements. Ntab1 will be composed with the lasts
  218. elements of tab1 ... tabN and NtabP with firsts elements of tab1 ... tabN.
  219. []max : [ [v1,v2,...vn] -- vMax ]
  220. replace the array on the top of the stack by the maximum value.
  221. []min : [ [v1,v2,...vn] -- vMin ]
  222. replace the array on the top of the stack by the minimum value.
  223. []min/max : [ [v1,v2,...vn] -- vMin vMax ]
  224. replace the array on the top of the stack by the minimum and maximum values.
  225. []prod : [ [v1,v2,...vn] -- v1*v2*...*vn ]
  226. replace the array on the top of the stack by the product of all values.
  227. []rev : [ [v1,v2,...vn] -- [vn ... v2,v1] ]
  228. reverse an array.
  229. []sum : [ [v1,v2,...vn] -- v1+v2+...+vn ]
  230. replace the array on the top of the stack by the sum of all values.
  231. []trot : [ tab1 tab2 ... tabN n -- Ntab1 ... NtabP ]
  232. trigonometric rotation with n arrays of P elements. Ntab1 will be composed with
  233. the firsts elements of tabN ... tab1 and NtabP with firsts elements of tabN ...
  234. tab1.
  235. []transp : [ tab1 tab2 ... tabN n -- Ntab1 ... NtabP ]
  236. computes the transpose of the matrix composed with n arrays of P elements.
  237. Ntab1 will be composed by the last line of this matrix and NtabP with the first
  238. line.
  239. about :
  240. displays the name of the system and the version.
  241. and : ( A B -- AandB )
  242. replaces the two booleans on the top of logical stack by the AND.
  243. cr :
  244. displays carriage-return (new line).
  245. depth : [ -- Stack_Depth ]
  246. returns the number of entries on the current number stack to the number stack.
  247. dramp : [ n -- [-n, ...,-1,0,1,2, ...,n] ]
  248. builds an array with 2n+1 elements and initialize it with a ramp (-n to n). It is in fact a double ramp.
  249. drop : [ E -- ]
  250. removes the top number stack entry.
  251. dup : [ E -- E E ]
  252. duplicates the top number stack entry.
  253. echo_off :
  254. sets the echo mode off.
  255. echo_on :
  256. sets the echo mode off.
  257. exit :
  258. terminates the program.
  259. false : ( -- false )
  260. puts false on the top of the logical stack.
  261. help :
  262. this help !! Need a word following.
  263. ls_clear : ( bool1 bool2 ... boolN -- )
  264. clears the logical stack.
  265. cs_clear : { str1 ... strn -- }
  266. clears the character stack.
  267. max : [ e1 e2 -- result ]
  268. calculates the maximun of e1 and e2.
  269. If e1 and e2 are arrays, they must have the same dimension and the result will
  270. be an array of this dimension with result[i] = max(e1[i], e2[i]).
  271. If e1 or e2 is an array the function adapts itself.
  272. As this operation is commutative the result will be the same if the array is in
  273. first or second position.
  274. min : [ e1 e2 -- result ]
  275. calculates the minimun of e1 and e2.
  276. If e1 and e2 are arrays, they must have the same dimension and the result will
  277. be an array of this dimension with result[i] = min(e1[i], e2[i]).
  278. If e1 or e2 is an array the function adapts itself.
  279. As this operation is commutative the result will be the same if the array is in
  280. first or second position.
  281. modulo : [ e1 e2 -- result ]
  282. calculates the rest of the division : e1 / e2.
  283. If e1 and e2 are arrays, they must have the same dimension and the result will
  284. be an array of this dimension with result[i] = e1[i] modulo e2[i].
  285. If e1 or e2 is an array the function adapts itself.
  286. WARNING : As this operation is NOT commutative the result will NOT be the same
  287. if the array is in first or second position.
  288. abs : [ v -- |v| ]
  289. take absolute value of the value on the top of the stack.
  290. neg : [ v -- -v ]
  291. negates the value on the top of the stack. Equivalent to "-1 *".
  292. not : ( A -- notA )
  293. replaces the boolean on the top of logical stack by his negation.
  294. or : ( A B -- AorB )
  295. replaces the two booleans on the top of logical stack by the OR.
  296. over : [ E2 E1 -- E2 E1 E2 ]
  297. duplicates the second number stack entry onto the top of the stack.
  298. pick : [ En ... E1 n -- En ... E1 En ]
  299. copies the n-th number stack entry onto the top of the stack.
  300. ramp : [ n -- [1,2, ...,n] ]
  301. builds an array with n elements and initialize it with a ramp (1 to n).
  302. roll : [ En En-1 ... E1 n -- En-1 ... E1 En ]
  303. moves the n-th number stack entry to the top of the stack.
  304. rot : [ E3 E2 E1 -- E2 E1 E3 ]
  305. rotates the third number stack entry to the top of the stack.
  306. rusage :
  307. display a board of ressources usage.
  308. s_clear : [ e1 ... en -- ]
  309. clears the number stack.
  310. sh :
  311. puts nife in background and open a shell. To come back in the program just exit
  312. the shell.
  313. sleep : [ n -- ]
  314. sleep during n seconds.
  315. swap : [ E2 E1 -- E1 E2 ]
  316. exchanges the top two number stack entries.
  317. time : [ -- N ]
  318. puts the time in microseconds on the top of the stack.
  319. true : ( -- true )
  320. puts true on the top of the logical stack.
  321. unroll : [ En-1 ... E2 E1 n -- E1 En-1 ... E2 ]
  322. moves the top number stack entry to the n-th position on the stack.
  323. unrot : [ E3 E2 E1 -- E1 E3 E2 ]
  324. rotates the top number stack entry to the third position on the stack. This is
  325. the reverse effect of "rot".
  326. xor : ( A B -- AxorB )
  327. replaces the two booleans on the top of logical stack by the XOR.
  328. vers : [ -- version ]
  329. puts the version value on the top of the stack.
  330. ">v : { string -- }
  331. initializes a variable with the top character stack entry.
  332. The name of the variable must follow this instruction. His previous content is
  333. lost.
  334. : :
  335. begins a function definition which the name is the first word following it. The end is indicate by ;.
  336. :! :
  337. begins a system function definition which the name is the first word following
  338. it. The end is indicate by ;. A such function take place in the User System
  339. functions list and cannot be removed.
  340. ; :
  341. ends a function definition that was begin by :.
  342. >v : [ E -- ]
  343. initializes a variable with the top stack entry.
  344. The name of the variable must follow this instruction. His previous content is
  345. lost.
  346. ?>v : ( boolean -- )
  347. initializes a variable with the top logical stack entry.
  348. The name of the variable must follow this instruction. His previous content is
  349. lost.
  350. ?console : [ n -- ]
  351. displays the background console of task number n.
  352. ?f :
  353. display the function stack.
  354. ?t :
  355. display the task stack.
  356. ?task_run : [ n -- ] ( -- true/false )
  357. tests if the task number n is running and put a boolean on the logical stack.
  358. ?v :
  359. display the variable stack.
  360. Task : [ -- no_task ]
  361. creates a task from a function. The name of the function must following it.
  362. The avaibles names are thoses giving by ?f. In success, the task number is on
  363. the numerical stack.
  364. Var :
  365. creates an empty global variable which the name is the first word following it.
  366. The variables are multiforms and can content scalar, array, boolean, string or
  367. a function name. In this case, it is an executable variable.
  368. "Var :
  369. creates an empty global variable which the name is on the character stack.
  370. The variables are multiforms and can content scalar, array, boolean, string or
  371. a function name. In this case, it is an executable variable.
  372. again :
  373. use in function programmation to create an infinite loop. For example :
  374. : f1 ... begin ... again ... ;
  375. This must be done into a function (beetween : and ;).
  376. begin :
  377. use in function programmation to create a loop. For example :
  378. : f1 ... begin ... [condition] while ... repeat ... ;
  379. : f2 ... begin ... [condition] until ... ;
  380. or infinite loop :
  381. : f3 ... begin ... again ... ;
  382. This must be done into a function (beetween : and ;).
  383. break :
  384. use in function programmation to exit a loop. For example :
  385. : f1 ... begin ... [condition] if ... break then ... again ... ;
  386. This must be done into a function (beetween : and ;).
  387. del_func :
  388. delete the more recent version of a function.
  389. The name of the function must follow this instruction.
  390. del_afunc :
  391. delete all functions beginning by a prefix.
  392. The prefix of the function must follow this instruction.
  393. del_ofunc :
  394. delete the oldest version of a function.
  395. The name of the function must follow this instruction.
  396. del_task : [ n -- ]
  397. delete the task number n.
  398. del_var :
  399. delete a variable. The name of the variable must follow this instruction.
  400. else :
  401. use to make a test. For example :
  402. toto 1 > if 12 else -7 then
  403. At execution time, if toto is greater than 1 12 is put on the stack else -7 is
  404. put. Then dup is executed.
  405. This must be done into a function (beetween : and ;).
  406. fdrop :
  407. removes the top function stack entry. In fact, the last function created.
  408. fscan :
  409. display the result of reverse engineering scanner for a function.
  410. The name of the function must follow this instruction.
  411. if :
  412. use to make a test. For example :
  413. toto 1 > if 12 else -7 then
  414. At execution time, if toto is greater than 1 12 is put on the stack else -7 is
  415. put. Then dup is executed.
  416. This must be done into a function (beetween : and ;).
  417. in :
  418. used to complete the install commands.
  419. Example : install f1 in var
  420. install :
  421. installs a function in a variable. The name must follow this instruction.
  422. This name will be search first in libraries and after in user functions.
  423. Example : install drop in var
  424. install_f :
  425. installs a function in a variable. The name must follow this instruction.
  426. This name will be search first in user functions and after in libraries.
  427. Example : install_f f1 in var
  428. install_v :
  429. installs the content of a variable in another variable. The source name must
  430. follow this instruction.
  431. This name will be search only in variables list.
  432. Example : install_v v1 in v2
  433. load :
  434. loads a source file. The name of the file must follow this instruction.
  435. "load : { "filename" -- }
  436. loads a source file taking the name of the file on the top of character stack.
  437. myself :
  438. use in a function definition to call the function herself (recursive case).
  439. This must be done into a function (beetween : and ;).
  440. repeat :
  441. use in function programmation to create a loop. For example :
  442. : fonction ... begin ... [condition] while ... repeat ... ;
  443. This must be done into a function (beetween : and ;).
  444. reset_var :
  445. resets a variable. The name of the variable must follow this instruction.
  446. return :
  447. ends the execution into a function.
  448. stop_task : [ n -- ]
  449. stop the task number n.
  450. then :
  451. use to make a test. For example :
  452. toto 1 > if 12 else -7 then
  453. At execution time, if toto is greater than 1 12 is put on the stack else -7 is
  454. put. Then dup is executed.
  455. This must be done into a function (beetween : and ;).
  456. until :
  457. use in function programmation to create a loop. For example :
  458. : f1 ... begin ... [condition] until ... ;
  459. This must be done into a function (beetween : and ;).
  460. var_down :
  461. set DOWN execution of variables.
  462. To execute an instruction seach first in user functions, and then in system
  463. libraries, and finaly in variables.
  464. var_off :
  465. set OFF execution of variables.
  466. To execute an instruction seach first in user functions and then in system
  467. libraries. No seach in variables.
  468. var_up :
  469. set UP execution of variables.
  470. To execute an instruction seach first in variables, then in user functions and
  471. finaly in system libraries.
  472. while :
  473. use in function programmation to create a loop. For example :
  474. : fonction ... begin ... [condition] while ... repeat ... ;
  475. This must be done into a function (beetween : and ;).
  476. vdrop :
  477. removes the top variable stack entry. In fact, the last variable created.
  478. >csv [ tab1 tab2 ... tabn n -- ] { "filename;libtabn; ... ;libtab1" -- }
  479. create a file filename.csv with the n arrays on the top of the stack. The title of each line can be present after the filename without ".csv", separate by ';'.
  480. >net : [ E1 E2 ... En n -- ]
  481. transfert the n elements from local stack to Net stack using NetKey.
  482. ?n :
  483. display the Net informations.
  484. ?ns :
  485. display the Net stack using NetKey.
  486. ndepth : [ -- Net_Stack_Depth ]
  487. returns the number of entries on the Net stack using NetKey.
  488. NetKey : [ key -- ]
  489. change the value of NetKey. It is a 32 bits INTEGER.
  490. NetErr : [ -- err_value ]
  491. put the Net Error value on the top of the stack. It is the negative of NetKey!
  492. NetServer : { "ServerName" -- }
  493. change the default NetServer (localhost).
  494. ndrop :
  495. drop the elements on the Net stack using NetKey.
  496. net> : [ -- E1 E2 ... En ]
  497. transfert all elements from Net stack to local stack using NetKey.
  498. netDt> : [ -- dt ]
  499. get the dt value. It represents the difference between the clock of the network
  500. and the local clock.
  501. This value must be used before sending time value to the net stack, or after
  502. getting time value from the net stack. For examples :
  503. On system A :
  504. time netDt> + 1 >net # transform the local time in network scale and send it.
  505. On system B :
  506. net> netDt> - # get the time of A and translate it in local scale.
  507. netOff :
  508. disconnect from Nife network.
  509. netOn : { "UserName" -- }
  510. connect to Nife network using the NetServer variable. The UserName is memorized
  511. and can be get by Me.
  512. Me : { -- "UserName" }
  513. put on the top of character stack the username. It is the name given with the
  514. last netOn command, or, if absent, the content of environment variables, in
  515. order : NIFENAME, LOGNAME, USERNAME, USER or "Nobody" if variables are absent.
  516. netExec : { "func_name" "UserName" -- }
  517. send a Nife RPC call to execute the function func_name on the system Username.
  518. The result will be send on the network using the current NetKey. If UserName is
  519. not existant, an error occurs. But if func_name does not exist, or fails in the
  520. execution, the negative value of NetKey (NetErr) is returned on the net stack.
  521. netCompile : { "source_file" "UserName" -- }
  522. send a Nife source file to compile it (like load) on the system Username.
  523. If source file does not exist, or UserName is absent an error occurs. If the
  524. file containts function call, the result will be send on the network using
  525. the current NetKey.
  526. If an error occurs during the compilation or the execution, the negative value
  527. of NetKey (NetErr) is returned on the net stack.
  528. srusage :
  529. display a board of NetServer ressources usage.
  530. stopServer :
  531. Tell the NetServer to stop after netOff if no other user is present.
  532. []-sub : [ [v1,v2,...,vl,...,vn] l -- [v1,v2,...,vl] ]
  533. extract a left sub-array from an array. If l > n fill zeros on left side.
  534. []sub : [ [vn,...,vl,...,v2,v1] l -- [vl,...,v2,v1] ]
  535. extract a right sub-array from an array. If l > n fill zeros on right side.
  536. *[]-sub : [ tab1 tab2 ... tabN N l -- tabl1 tabl2 ... tablN ]
  537. extract a left sub-array like sub[] from N arrays. The N arrays have l elements after execution.
  538. *[]sub : [ tab1 tab2 ... tabN N l -- tabl1 tabl2 ... tablN ]
  539. extract a right sub-array like []sub from N arrays. All arrays have l elements after execution.
  540. do : [ limit val -- ]
  541. use in function programmation to create a loop with an index going from val to
  542. limit. Use loop for auto-convergent loop. For examples :
  543. : f1 5 0 do ... loop ... ;
  544. a loop with an index going from 0 to 4 incremented by 1 (i = 0,1,2,3,4).
  545. : f 0 5 do ... loop ... ;
  546. a loop with an index going from 5 to 1 decremented by 1 (i = 5,4,3,2,1).
  547. : f2 15 1 do ... 3 +loop ... ;
  548. a loop with an index going from 1 to 15 incremented by 3 (i = 1,4,7,10,13).
  549. This must be done into a function (beetween : and ;).
  550. loop :
  551. use in function programmation to create an auto-convergent loop with do using
  552. the default 1 by 1 progression. For example :
  553. : f 5 0 do ... loop ... ;
  554. a loop with an index going from 0 to 4 incremented by 1 (i = 0,1,2,3,4).
  555. : f 0 5 do ... loop ... ;
  556. a loop with an index going from 5 to 1 decremented by 1 (i = 5,4,3,2,1).
  557. This must be done into a function (beetween : and ;).
  558. +loop : [ inc -- ]
  559. use in function programmation to create a loop with do using the value inc for
  560. incrementation. For example :
  561. : f 15 1 do ... 3 +loop ... ;
  562. a loop with an index going from 1 to 15 incremented by 3 (i = 1,4,7,10,13).
  563. This must be done into a function (beetween : and ;).
  564. ndo : [ n -- ]
  565. returns the number of do-loop in the running context.
  566. It's usefull before using the indexes I J or K.
  567. I : [ -- val ]
  568. returns the value of the index of the current do-loop.
  569. This must be done into a function (beetween : and ;).
  570. J : [ -- val ]
  571. returns the value of the index of the do-loop containing the current one.
  572. This must be done into a function (beetween : and ;).
  573. K : [ -- val ]
  574. returns the value of the index of the second level do-loop containing the
  575. current one.
  576. This must be done into a function (beetween : and ;).
  577. do_next : [ -- ]
  578. free-context instruction to bypass the end of a loop and go to the next step.
  579. do_leave : [ -- ]
  580. free-context instruction to finish the current loop.
  581. *do_leave : [ n -- ]
  582. free-context instruction to finish the n currents loops.
  583. ?gp :
  584. display the gplot stack.
  585. del_gplot : [ n -- ]
  586. delete the gplot number n. The file is deleted but the screen is keeped.
  587. gplot : { "filename" "title" -- }
  588. create a gplot for one plot having as title "title" and working with the file
  589. filename.
  590. gplotM : [ n -- ] { "filename" "title" -- }
  591. create a gplot for n (Multiple) plots having as title "title" and working with
  592. the file filename.
  593. gplotCmd : [ n -- ] { "options" -- }
  594. updating the string command option of gplot number n.
  595. gplotClear : [ n -- ]
  596. clear the file of the gplot number n.
  597. gplotAdd : [ tab n -- ]
  598. add at the end of the file of gplot number n, a line with data of tab.
  599. gplotRepl : [ tab n -- ]
  600. remove the first line and add at the end of the file of gplot number n, a line
  601. with data of tab.
  602. gplotRaz :
  603. remove all gplots. The files are deleted but the screens are keeped.
  604. ?dev :
  605. lists all the devices available. The DID is at the beginning of the lines.
  606. dev_dflt : [ DID SID CID -- ]
  607. defines default values in order Device ID, Subdevice ID and Channel ID.
  608. ?dev_dflt :
  609. shows informations about the default values device (DID, SID, CID).
  610. dev_dflR : [ -- VAL ]
  611. read the device using the default values DID, SID and CID.
  612. dev_dflW : [ VAL -- ]
  613. write the value VAL on the device using the default values DID, SID and CID.
  614. dev_info : [ DID -- ]
  615. shows informations about device DID.
  616. dev_read : [ DID SID CID -- VAL ]
  617. read the device DID, sub-device SID and channel CID, and put the value on the
  618. numeric stack.
  619. dev_write : [ VAL DID SID CID -- ]
  620. write the value VAL on the device DID, subdevice SID and channel CID.
  621. cos : [ v -- cos(v) ]
  622. compute the cosinus of the value on the top of the stack.
  623. sin : [ v -- sin(v) ]
  624. compute the sinus of the value on the top of the stack.
  625. onerr: :
  626. defines, into a function (beetween : and ;), a label for programming an errors
  627. treatment in case of an error occurs.
  628. end: :
  629. defines, into a function (beetween : and ;), a label for programming a end
  630. treatment. In case of an error occurs, theses instructions will be executed if
  631. this label is AFTER the onerr: label.
  632. goto_end :
  633. instruction, into a function (beetween : and ;), to go to the end: label.
  634. ?err : ( -- T/F )
  635. tests if an error have occured and put true or false, on the logical stack.
  636. ?lasterr :
  637. displays the last error elements.
  638. messerr : [ n -- ] { -- "error message" }
  639. puts on the character stack the error message number n.
  640. noerr : [ -- n ]
  641. gives the number of last error.
  642. ?i2c :
  643. lists all the I2C buses available. The I2C-ID is at the beginning of the lines.
  644. i2c_info : [ I2C-ID -- ]
  645. shows informations (matrix) about the I2C-ID interface.
  646. i2c_write : [ Value Offset Address I2C-ID -- ]
  647. write Value at data-address Offset for chip-address Address of I2C interface
  648. I2C-ID.
  649. i2c_read : [ Offset Address I2C-ID -- Value ]
  650. read at data-address Offset for chip-address Address of I2C interface I2C-ID.
  651. If Offset equal -1, the read is done directly at Address.