Varför kan jag inte inte anropa A -- B -- C ?

Lennart Öhman lennart.ohman@REDACTED
Tue Oct 14 12:21:07 CEST 2003


Hi, the -- operator works with two arguments. I think you shall
concider what you did as:

[1,2,3,4,5,6] -- (A -- (B -- C)).

If you try

((([1,2,3,4,5,6] -- A) -- B) -- C).

I beleive you will accomplish what you intended.

Best Regards,
Lennart


Anders Fluur (LN/EAB) wrote:
> Hej,
> Varför kan jag inte inte anropa A -- B -- C, när A ++ B ++ C fungerar?
>  
> (erlang)82 <mailto:e_Erlang__Global_pm1_1_2_1@)82>> A = [1,2].
> [1,2]
> (erlang)83 <mailto:erlang__Global_pm1_1_2_1@)83>> B=[3,4].
> [3,4]
> (erlang)84 <mailto:e_Erlang__Global_pm1_1_2_1@)84>> C=[5,6].
> [5,6]
> (erlang)85 <mailto:erlang__Global_pm1_1_2_1@)85>> [1,2,3,4,5,6]--A--B--C.
> [3,4,5,6]
> (erlang)86 <mailto:e_Erlang__Global_pm1_1_2_1@)86>> A++B++C.
> [1,2,3,4,5,6]
>  
> Mvh
> Anders
> 


-------------------------------------------------------------
Lennart Ohman                   phone   : +46-8-587 623 27
Sjoland & Thyselius Telecom AB  cellular: +46-70-552 6735
Sehlstedtsgatan 6               fax     : +46-8-667 8230
SE-115 28 STOCKHOLM, SWEDEN     email   : lennart.ohman@REDACTED




More information about the erlang-questions mailing list