Is the world coming to an end?

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Sun Apr 3 11:38:47 PDT 2011


On 4/3/11 1:37 PM, spir wrote:
> On 04/03/2011 07:57 PM, Nick Sabalausky wrote:
>> "Michel Fortin"<michel.fortin at michelf.com> wrote in message
>> news:ina7e9$2kdh$1 at digitalmars.com...
>>> On 2011-04-03 12:04:42 -0400, Adam D. Ruppe<destructionator at gmail.com>
>>> said:
>>>
>>>> btw, it might be worth considering a change to overflow. Suppose
>>>> there was a way to get arbitrary size ints passed to a template.
>>>> Then, the library could do its own overflow checks, or not, enabling
>>>> things like bigint literals in this same fashion.
>>>>
>>>> Though, I don't think it's a big benefit. It'd be really weird
>>>> to use (a new compile time only datatype?)
>>>
>>> I've been thinking about the same thing, except instead of having a
>>> special data type the template would simply take a string:
>>>
>>> template binary(string digits) {
>>> ...
>>> }
>>>
>>> binary!1111_1111_0000_0000;
>>> // no error, number "1111_1111_0000_0000" passed as a string to the
>>> template.
>>>
>>
>> I've always thought that we should be able to do something like this:
>>
>> template foo(int val)
>> {
>> enum foo = val.meta.argString;
>> }
>> static assert(foo!(2+3) == "2+3");
>
> That's Lisp (or Io): non-evaluated arguments (messages). Next century in
> compiled languages ;-)

No, that's C's last century's "#" prefix.


Andrei



More information about the Digitalmars-d mailing list