RosettaCodeData/Task/Dynamic-variable-names/Rebol/dynamic-variable-names.rebol
2026-04-30 12:34:36 -04:00

14 lines
620 B
Text

Rebol [
Title: "Dynamic Variable Name"
URL: http://rosettacode.org/wiki/Dynamic_variable_names
]
; Here, I ask the user for a name, then convert it to a word and
; assign the value "Hello!" to it. To read this phrase, realize that
; Rebol collects terms from right to left, so "Hello!" is stored for
; future use, then the prompt string "Variable name? " is used as the
; argument to ask (prompts user for input). The result of ask is
; converted to a word so it can be an identifier, then the 'set' word
; accepts the new word and the string ("Hello!") to be assigned.
set to-word ask "Variable name? " "Hello!"