Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- sub_atom_* is mostly for when you are needidng to created and decompose new global identifiers
- 2:49 PM same as with atom_concat/3
- 2:51 PM teh reason to use use global identifiers (atoms) is that they can be hashed in the prolog database
- 2:51 PM well they hash for free
- 2:52 PM the hashcode gets created at the time of concatenation
- 2:53 PM (because it gets found/created at that moment)
- 2:54 PM like i'll atom_concat('Player',2,PlayerID).
- 2:55 PM ⇐ pie_ quit (~pie_@unaffiliated/pie-/x-0787662) Ping timeout: 272 seconds
- 2:57 PM
- <stoopkid> so you say that stuff like "atom_concat('Player',2,PlayerID)" is now generally frowned upon?
- 3:01 PM
- <dmiles> ... sorry, no, that isnt frowned upon.. but would would be is what people youed to do like ..
- 3:02 PM atom_concat('Player you ID number was ',2,PrintMe)
- 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
- 3:03 PM
- <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?
- 3:03 PM
- <dmiles> ... correct
- 3:04 PM
- <stoopkid> so in general if i'm outputting it as text, use a string?
- 3:04 PM
- <dmiles> ... yes.. whenever your onl;y intent was to output it
- 3:05 PM also reading and taking in input should be a string
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement