Thread overview
Re: scoped imports
Aug 17, 2013
H. S. Teoh
Aug 17, 2013
bearophile
Aug 17, 2013
Timothee Cour
Aug 18, 2013
H. S. Teoh
Aug 18, 2013
bearophile
Aug 20, 2013
Brad Roberts
Aug 17, 2013
Timothee Cour
August 17, 2013
On Sat, Aug 17, 2013 at 03:29:56PM -0700, Timothee Cour wrote: [...]
> Related question:
> 
> Why isn't the following allowed:
> ----
> void fun(){
> // code without version=A
>   version=A;
> // code with version=A
>   vesion(none):
> //code versioned out
> }
> ----
> I understand the grammar doesn't allow it, but what's the rationale, and can it be fixed?

Not exactly sure what you're trying to achieve, but isn't this what you want:

	void fun() {
		version(A) {
			...
		} else {
			..
		}
	}

?

Or are you trying to change version=A inside the function?


T

-- 
"Outlook not so good." That magic 8-ball knows everything! I'll ask about Exchange Server next. -- (Stolen from the net)
August 17, 2013
H. S. Teoh:

Most of your answer posts break threads. I suggest you to try to find ways to avoid that.

Bye,
bearophile
August 17, 2013
On Sat, Aug 17, 2013 at 4:24 PM, bearophile <bearophileHUGS@lycos.com>wrote:

> H. S. Teoh:
>
> Most of your answer posts break threads. I suggest you to try to find ways to avoid that.
>

This issue keeps reappearing and people keep complaining; it's not his fault, the problem is with the forum.dlang.org and that should be fixed instead.


August 17, 2013
On Sat, Aug 17, 2013 at 3:36 PM, H. S. Teoh <hsteoh@quickfur.ath.cx> wrote:

> On Sat, Aug 17, 2013 at 03:29:56PM -0700, Timothee Cour wrote: [...]
> > Related question:
> >
> > Why isn't the following allowed:
> > ----
> > void fun(){
> > // code without version=A
> >   version=A;
> > // code with version=A
> >   vesion(none):
> > //code versioned out
> > }
> > ----
> > I understand the grammar doesn't allow it, but what's the rationale, and can it be fixed?
>
> Not exactly sure what you're trying to achieve, but isn't this what you want:
>
>         void fun() {
>                 version(A) {
>                         ...
>                 } else {
>                         ..
>                 }
>         }
>
> ?
>
> Or are you trying to change version=A inside the function?
>

The latter:  having 'version=A '  inside the function.
Currently we can only set version=A at module scope, not function scope. I
don't understand the rationale for this limitation.
Likewise with 'version(A):' which is allowed at module scope but not
function scope, ; this would be  especially useful with 'version(none):'.


>
> T
>
> --
> "Outlook not so good." That magic 8-ball knows everything! I'll ask about Exchange Server next. -- (Stolen from the net)
>


August 18, 2013
On Sun, Aug 18, 2013 at 01:24:12AM +0200, bearophile wrote:
> H. S. Teoh:
> 
> Most of your answer posts break threads. I suggest you to try to find ways to avoid that.
[...]

Unfortunately, it's not within my control. It's the mailing list to NNTP gateway that has a bug where message IDs are sometimes rewritten when they're not supposed to be. I suggest you should pester the listmaster instead, that way, we'll get a solution that works for everybody, not just for me. :)


T

-- 
What do you mean the Internet isn't filled with subliminal messages? What about all those buttons marked "submit"??
August 18, 2013
H. S. Teoh:

> Unfortunately, it's not within my control. It's the mailing list to NNTP
> gateway that has a bug where message IDs are sometimes rewritten when
> they're not supposed to be. I suggest you should pester the listmaster
> instead, that way, we'll get a solution that works for everybody, not
> just for me. :)

I see, OK, and sorry.

Bye,
bearophile
August 20, 2013
On 8/17/13 5:20 PM, H. S. Teoh wrote:
> On Sun, Aug 18, 2013 at 01:24:12AM +0200, bearophile wrote:
>> H. S. Teoh:
>>
>> Most of your answer posts break threads. I suggest you to try to
>> find ways to avoid that.
> [...]
>
> Unfortunately, it's not within my control. It's the mailing list to NNTP
> gateway that has a bug where message IDs are sometimes rewritten when
> they're not supposed to be. I suggest you should pester the listmaster
> instead, that way, we'll get a solution that works for everybody, not
> just for me. :)
>
>
> T
>

Don't pester the list master either, which is me.  Get the mailman software fixed.