1. DAHH another question

I have a sequence {a,b,c}

-- how do i append or concantenate two zeros to it

to get this result {a,b,c,0,0}

new topic     » topic index » view message » categorize

2. Re: DAHH another question

Try the following:

d = {a, b, c} & {0, 0}

same as:

e = {a, b, c}
f = {0, 0}

d = e & f

The & concantenate operator drops the inside brackets.

Cheers,
Nick

Bernie Ryan wrote:

> I have a sequence {a,b,c}
>
> -- how do i append or concantenate two zeros to it
>
> to get this result {a,b,c,0,0}

new topic     » goto parent     » topic index » view message » categorize

3. Re: DAHH another question

At 01:23 PM 5/13/99 -0400, you wrote:
>I have a sequence {a,b,c}
>
>-- how do i append or concantenate two zeros to it
>
>to get this result {a,b,c,0,0}

Doesn't '&' accomplish this?

--proof positive program
sequence x, z, new
atom y

x = {1,2,3}
y = 0
z = {0,0}

? x & y          -- prints {1,2,3,0}
? x & z          -- prints {1,2,3,0,0}
? append(x, y)   -- prints {1,2,3,0}
? append(x, z)   -- prints {1,2,3,{0,0}}

Don't use append when you're appending a sequence... otherwise, you'll get
what you see. smile

new topic     » goto parent     » topic index » view message » categorize

4. Re: DAHH another question

Nick! Where the heck is it 3:58AM on 5/14/99 (the date of your message)? smile

At 03:58 AM 5/14/99 +1000, you wrote:
>Try the following:
>
>d = {a, b, c} & {0, 0}
>
>same as:
>
>e = {a, b, c}
>f = {0, 0}
>
>d = e & f
>
>The & concantenate operator drops the inside brackets.
>
>Cheers,
>Nick
>
>Bernie Ryan wrote:
>
>> I have a sequence {a,b,c}
>>
>> -- how do i append or concantenate two zeros to it
>>
>> to get this result {a,b,c,0,0}

new topic     » goto parent     » topic index » view message » categorize

5. Re: DAHH another question

Thanks everybody for your help !

PS: Nick you better change your clock chip or CMOS battery.

new topic     » goto parent     » topic index » view message » categorize

6. Re: DAHH another question

Hi, C.K. My insane lifestyle usually means I am online in the wee short hours
here in Oz.  This may correspond convieniently or not to around high noon in the
states.  Sorry it causes strange confusions....  8?,
--Nick

C. K. Lester wrote:

> Nick! Where the heck is it 3:58AM on 5/14/99 (the date of your message)? smile
>
> At 03:58 AM 5/14/99 +1000, you wrote:
> >Try the following:
> >
> >d = {a, b, c} & {0, 0}
> >
> >same as:
> >
> >e = {a, b, c}
> >f = {0, 0}
> >
> >d = e & f
> >
> >The & concantenate operator drops the inside brackets.
> >
> >Cheers,
> >Nick
> >
> >Bernie Ryan wrote:
> >
> >> I have a sequence {a,b,c}
> >>
> >> -- how do i append or concantenate two zeros to it
> >>
> >> to get this result {a,b,c,0,0}

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu