Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS 

insert-MRU MRU list function

insert-MRU: func [
    "Insert value in series; removing first existing instance."
    series [series!] 
    value 
    /limit size [integer!] "Limit the series to the given size by removing the last item."
][
    remove find/only series value
    insert/only series value
    if all [size  size < length? series] [remove back tail series]
    series
]
« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS