SHARE
TWEET

Untitled

a guest Aug 23rd, 2019 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. sub_atom_* is mostly for when you are needidng to created and decompose new global identifiers
  2. 2:49 PM same as with  atom_concat/3
  3. 2:51 PM teh reason to use use global identifiers (atoms) is that they can be hashed in the prolog database
  4. 2:51 PM well they hash for free
  5. 2:52 PM the hashcode gets created at the time of concatenation
  6. 2:53 PM (because it gets found/created at that moment)
  7. 2:54 PM like i'll atom_concat('Player',2,PlayerID).
  8. 2:55 PM ⇐ pie_ quit (~pie_@unaffiliated/pie-/x-0787662) Ping timeout: 272 seconds
  9. 2:57 PM
  10. <stoopkid> so you say that stuff like "atom_concat('Player',2,PlayerID)" is now generally frowned upon?
  11. 3:01 PM
  12. <dmiles> ... sorry, no, that isnt frowned upon.. but would would be is what people youed to do like ..
  13. 3:02 PM atom_concat('Player you ID number was ',2,PrintMe)
  14. 3:03 PM atom_concat('Player',2,PlayerID) finds or creates 'Player2' in the atom table.. which will be used to access the prolog database
  15. 3:03 PM
  16. <stoopkid> so it's not frowned upon if you're just generating an internally-used identifier, but is frowned upon if you're planning to use it in I/O or whatever?
  17. 3:03 PM
  18. <dmiles> ... correct
  19. 3:04 PM
  20. <stoopkid> so in general if i'm outputting it as text, use a string?
  21. 3:04 PM
  22. <dmiles> ... yes.. whenever your onl;y intent was to output it
  23. 3:05 PM also reading and taking in input  should be a string
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top