[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Tuples and other constant values
- From: Tim Hill <drtimhill@...>
- Date: Wed, 8 Jul 2015 15:05:18 -0700
> On Jul 8, 2015, at 12:35 PM, Parke <parke.nexus@gmail.com> wrote:
>
> On Wed, Jul 8, 2015 at 11:34 AM, Dirk Laurie <dirk.laurie@gmail.com> wrote:
>> Similarly:
>>
>> a = c
>>
>> would be generate "attempt to assign a constant object to
>> a non-constant name", but
>>
>> const a = c
>>
>> would be OK.
>
> So if a function returned a tuple (or any other constant value), you
> would also need to declare that the function returned a constant
> value, so that the interpreter could know and generate appropriate
> compile time errors?
>
> -Parke
>
Except checking this kind of thing at compile time is very expensive, as it requires flow analysis and all sorts of other nasty (=expensive) processing. Trying to declare variables (rather than values) as const is fraught with difficulties, hence my post about making this a property of a value.
—Tim
- References:
- Tuples and other constant values, Dirk Laurie
- Re: Tuples and other constant values, Cosmin Apreutesei
- Re: Tuples and other constant values, Coda Highland
- Re: Tuples and other constant values, Cosmin Apreutesei
- Re: Tuples and other constant values, Tim Hill
- Re: Tuples and other constant values, Coda Highland
- Re: Tuples and other constant values, Tim Hill
- Re: Tuples and other constant values, Jay Carlson
- Re: Tuples and other constant values, Daurnimator
- Re: Tuples and other constant values, Tim Hill
- Re: Tuples and other constant values, Dirk Laurie
- Re: Tuples and other constant values, Parke
- Re: Tuples and other constant values, Dirk Laurie
- Re: Tuples and other constant values, Parke