functional programming - Inverting order of multiple values in Common Lisp -


i've been thinking following problem. suppose i'm dealing function returning multiple values, such truncate. there clever way reverse order of values returned? i'm talking more clever e.g.

(multiple-value-bind (div rem) (truncate x y)   (values rem div)) 

i don't know how clever is, here's want:

(reverse (multiple-value-list (the-function-that-returns-multiple-values))) 

multiple-value-list being key, here.

to return these again separate values, use values-list:

(values-list (reverse (multiple-value-list (the-function-that-returns-multiple-values)))) 

this whole page may enlightening.


Comments

Popular posts from this blog

authentication - Mongodb revoke acccess to connect test database -

r - Update two sets of radiobuttons reactively - shiny -

ios - Realm over CoreData should I use NSFetchedResultController or a Dictionary? -