Atribuição de lista paralela no idioma vermelho
Eu tenho 2 listas:
alist: [a b c d]
blist: [1 2 3 4]
(Na realidade, são longas listas). Como posso atribuir variáveis in alist a valores correspondentes em blist de uma só vez? Portanto, a se torna 1, b se torna 2 e assim por diante.
Eu tentei:
foreach i alist j blist [i: j]
Mas dá o seguinte erro:
*** Script Error: j has no value
*** Where: foreach
*** Stack:
Eu também tentei:
i: 1
while [true] [
if i > (length? alist) [break]
alist/i: blist/i
i: i + 1
]
Mas também não funciona:
*** Script Error: cannot set none in path alist/i:
*** Where: set-path
*** Stack:
alist/i
eblist/i
Retornanone
(na verificação com o comando de impressão).
Perguntas semelhantes existem para outros idiomas também, por exemplo:Atribuição de array paralelo em PHP eAtribuição paralela em Java? . Obrigado pela ajuda.