Paste #40574: Untitled Paste

Date: 2017/03/08 19:59:56 UTC-08:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


#
#--------------------------------------
#
listDeduplicate:
# Return the string trimmed to the specified length
# Usage: <procedure[script:listDeduplicate|list:<list[]>].return>
  type: procedure
  debug: minimal
  script:
#    - define return <list[]>
#    - foreach start <list[<context.list>]> --save l:
#      - if <def[return].contains[<def[l]>].not>:
#        - addto return list <def[l]>
#    - determine return <def[return]>
#
    - define return <list[]>
    - foreach start <list[<context.list>]> --save l:
      - foreach start <def[return]> --save e:
        - if <def[l].equals_cased[<def[e]>]>:
          - define contains true
          - foreach stop
      - if <def_exists[contains].not>:
        - addto return list <def[l]>
      - undefine contains
    - determine return <def[return]>
#
#--------------------------------------