Advertisement
Guest User

Untitled

a guest
Jun 24th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. (class +DEnt +Entity) #Ancestor for project data classes
  2. (rel id (+Key +String))
  3. (rel dsc (+Idx +String))
  4. #----------------------------
  5. (class +Folder +DEnt)
  6. #----------------------------
  7. (class +User +DEnt)
  8. #(extend +User)
  9. (rel nam (+String))
  10.  
  11. (pool (tmp "db"))
  12.  
  13. (new T '(+Folder) 'id "FOLDER1" 'dsc "Folder 1")
  14. (new T '(+Folder) 'id "FOLDER2" 'dsc "Folder 2")
  15. (new T '(+Folder) 'id "FOLDER3" 'dsc "Folder 3")
  16. (new T '(+User) 'id "USER1" 'dsc "User 1")
  17. (new T '(+User) 'id "USER2" 'dsc "User 2")
  18. (new T '(+User) 'id "USER3" 'dsc "User 3")
  19. (commit)
  20. #End of file
  21.  
  22. : (scan (tree 'id '+DEnt))
  23. "FOLDER1" {2}
  24. "FOLDER2" {6}
  25. "FOLDER3" {7}
  26. "USER1" {10}
  27. "USER2" {11}
  28. "USER3" {12}
  29. -> {4}
  30. : (get '{12} 'id)
  31. -> "USER3"
  32. : (put!> '{12} 'id "USER1")
  33. -> "USER1"
  34. : (get '{12} 'id)
  35. -> "USER1"
  36. : (get '{10} 'id)
  37. -> "USER1"
  38. : (scan (tree 'id '+DEnt))
  39. "FOLDER1" {2}
  40. "FOLDER2" {6}
  41. "FOLDER3" {7}
  42. "USER1" {10}
  43. "USER2" {11}
  44. -> {4}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement