Guest User

WPL Doc/Notes

a guest
Oct 16th, 2013
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.03 KB | None | 0 0
  1. This is not complete,
  2.  
  3. Here is the documentation so far
  4. (it is also commented into the source code)
  5.  
  6.  
  7. Data Types (kinda):
  8.  
  9. Everything defaults into a string
  10.  
  11. numbers default into ints (I will problably change that to floats sometime)
  12.  
  13. To create a string (that is more then one word) the syntax is:
  14. " words words words "
  15. (Note the space inbetween " and words.)
  16.  
  17. Keywords and stuff:
  18.  
  19. display (the print statement) "disp"
  20.  
  21. disp words
  22. words
  23. disp 3
  24. 3
  25.  
  26.  
  27. if statement. syntax is "if true do this end"
  28. if true disp words end
  29. words
  30. if false disp words end
  31. (nothing prints)
  32.  
  33. while loop.
  34. Syntax:
  35. while true
  36. do this
  37. do this
  38. end
  39.  
  40. while whatever follows while is true, the code inside will loop.
  41.  
  42. dotims.
  43. dotims (as in, do times) is similar to the while loop.
  44. repeats a line of code x amount of times (where x is an int)
  45. Syntax:
  46. dotims 3 do this end
  47. (this would 'do this' three times)
  48.  
  49.  
  50. comments.
  51. code code // this is a comment
  52. (NOTE: NOTICE THE SPACE BETWEEN // AND THE COMMENT)
  53.  
  54. D! prints the dictionary of stored values and functions
  55. L! prints the line (usually used for debugging)
  56.  
  57. Oporators/Calculations:
  58.  
  59. Right now I only have +, - and =
  60.  
  61. + works with ints and strings
  62. disp 3 + 3
  63. 6
  64. disp hello + world
  65. helloworld
  66. disp three + 3
  67. three3
  68.  
  69. - works with ints but not strings
  70. disp 3 - 3
  71. 0
  72. disp 3 - 4
  73. -1
  74. disp 4 - 3
  75. 1
  76.  
  77. * multiplication works with ints and strings
  78. disp 2 * 2
  79. 4
  80. disp hello * 2
  81. hellohello
  82.  
  83. / devision, works with ints, allways rounds down
  84. disp 12 / 4
  85. 1
  86. disp 12 / 5
  87. 2
  88.  
  89.  
  90. % mod, works with ints,
  91. returns the remainder when devinding two numbers
  92.  
  93. disp 13 % 4
  94. 1
  95.  
  96. = will place either "true" or "false" in its place
  97.  
  98. disp 3 = 3
  99. true
  100. disp 3 = 3 = false
  101. false
  102. > and <, greater then, less then. puts either true or false in its place
  103.  
  104. disp 2 > 3
  105. false
  106. disp 2 < 3
  107. true
  108.  
  109. NOTE: CALCULATIONS ARE ALWAYS DONE LEFT TO RIGHT.
  110. I KNOW IT CAN BE A PAIN IN THE ASS BUT DEAL WITH IT
  111.  
  112. Functions and variables:
  113.  
  114. All functions and variables are stored in a dictionary called d
  115.  
  116. Variables are a single word (int or sting) saved to another word.
  117. Syntax:
  118. x -> 3
  119. d would be {"x":3}
  120. x -> word
  121. d would be {"x":"word"}
  122. x -> " this is x "
  123. d would be {"x":"this is x"}
  124.  
  125. Functions are a series of words saved to a single word.
  126. Syntax:
  127. helloworld : disp " hello world " ;
  128. d would be {"helloworld": ["hello world", "disp"] (NOTE: it stores it backwards, read the source code if you are interested in why)
  129. typing helloword would put ' disp "hello world" ' in the line in its place
  130.  
  131.  
  132. Notes:
  133. I have grown acustom to starting all scripts with author -> " Wesley "
  134. and ending each script with D! so running the script will tell the author
  135.  
  136. If something doesnt seem to work, try putting every command on a new line.
  137. I am still building/exploring the language myself, so be patient.
  138.  
  139.  
  140. -Wesley Wooten
Advertisement
Add Comment
Please, Sign In to add comment