[mercury-users] string append
David Overton
dmo at cs.mu.OZ.AU
Wed Aug 2 09:15:08 AEST 2000
On Tue, Aug 01, 2000 at 11:20:40PM +1000, Michael Day wrote:
>
> Hi,
>
> is use of the + operator to append strings considered poor coding style?
> If not, could this (or any functional form, really) be added to string.m?
>
> :- func string + string = string.
>
> S0 + S1 = S :- append(S0, S1, S).
>
> (Does anyone like using ++ to append lists, or can we at least get a
> functional variation of append?)
As Rob and Ralph have mentioned, there is already a functional version
of append (for both strings and lists). You can use it as an infix
operator by enclosing it in backquotes, e.g.:
S = S0 `append` S1 `append` S2
David
--
David Overton Department of Computer Science & Software Engineering
PhD Student The University of Melbourne, Victoria 3010, Australia
+61 3 8344 9159 http://www.cs.mu.oz.au/~dmo
--------------------------------------------------------------------------
mercury-users mailing list
post: mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe: Address: mercury-users-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------
More information about the users
mailing list