[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Mutable strings (Was: Hash Table Collisions (n.runs-SA-2011.004)
- From: Dirk Laurie <dirk.laurie@...>
- Date: Tue, 10 Jan 2012 23:24:14 +0200
>>
>> Is there going to be syntax for constructing "really string" literals?
>> If not, it can be implemented as a library operating on userdata,
>> rather like the `file:` functions.
>>
>> Which metamethods should it have?
>>
>> len, concat: like string
>> eq, le, lt: actual comparisons
>> add: bitwise `or`
>> sub: bitwise `nor`
>> mul: bitwise `and`
>> div: bitwise `nand`
>> unm: bitwise `not`
>> index: access to a byte
>> newindex: changing a byte
>
> If two string is not same length, then how to define these binary operations?
>
Two possiblities:
- it is an error
- the shorter string defines the length of the result
Which do you prefer?