Advertisement
Guest User

Untitled

a guest
Jun 18th, 2018
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. 15. fragment address
  2.  
  3. |= [nedl=* hay=*]
  4. =/ count=@ 1
  5. |- ^- (unit @)
  6. ?: =(nedl hay)
  7. [~ count]
  8. ?@ hay ~
  9. =/ head-search $(hay -.hay, count (mul 2 count))
  10. ?~ head-search
  11. $(hay +.hay, count +((mul 2 count)))
  12. head-search
  13.  
  14. 16. find and replace first fragment match
  15.  
  16. |= [nedl=* hay=* new=*]
  17. ^- *
  18. ?: =(nedl hay) new
  19. ?@ hay hay
  20. =/ new-head $(hay -.hay)
  21. ?: =(new-head -.hay)
  22. [-.hay $(hay +.hay)]
  23. [new-head +.hay]
  24.  
  25. 17. find and replace all fragment matches
  26.  
  27. |= [nedl=* hay=* new=*]
  28. ^- *
  29. ?: =(nedl hay)
  30. new
  31. ?@ hay hay
  32. :- $(hay -.hay)
  33. $(hay +.hay)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement