Sort three variables: Difference between revisions

no edit summary
m (→‎{{header|PureBasic}}: Added a comment to clarify sort order)
No edit summary
Line 1,678:
 
Three Python values:</pre>
 
=={{header|R}}==
 
<lang>
#lang R
 
assignVec <- Vectorize("assign", c("x", "value"))
`%<-%` <- function(x, value) invisible(assignVec(x, value, envir = .GlobalEnv))
</lang>
 
{{out}}
 
<lang>
x <- 'lions, tigers, and'
y <- 'bears, oh my!'
z <- '(from the "Wizard of OZ")'
 
c("x", "y", "z") %<-% sort(c(x, y, z))
 
x
## [1] "(from the \"Wizard of OZ\")"
y
## [1] "bears, oh my!"
z
## [1] "lions, tigers, and"
 
 
x <- 77444
y <- -12
z <- 0
 
c("x", "y", "z") %<-% sort(c(x, y, z))
 
x
## [1] -12
y
## [1] 0
z
## [1] 77444
</lang>
 
=={{header|Racket}}==
Anonymous user