Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.forth > #23635

Re: Melding strings and numbers

From "WJ" <w_a_x_man@yahoo.com>
Newsgroups comp.lang.forth
Subject Re: Melding strings and numbers
Date 2013-06-15 00:47 +0000
Organization A noiseless patient Spider
Message-ID <kpgdid$rl5$1@dont-email.me> (permalink)
References <kjepti$hpk$1@dont-email.me>

Show all headers | View raw


WJ wrote:

> You have a list of strings and a list of integers.
> Create a new list of strings by appending each integer
> to its corresponding string.
> 
> Factor:
> 
> USING: math.parser ;
> 
> { "aaa" "bb" "c" } { 1 2 3 } [ number>string append ] 2map .
> 
> { "aaa1" "bb2" "c3" }

Ruby:

["aaa","bb","c"].zip([1,2,3]).map{|s,n| s + n.to_s}
    ==>["aaa1", "bb2", "c3"]
 
How would this be done in Forth?

Back to comp.lang.forth | Previous | NextNext in thread | Find similar


Thread

Re: Melding strings and numbers "WJ" <w_a_x_man@yahoo.com> - 2013-06-15 00:47 +0000
  Re: Melding strings and numbers glidedog@gmail.com - 2013-06-30 04:41 -0700

csiph-web