"Peter Alexander" wrote in message
news:itsqov$1mnt$1...@digitalmars.com...
> On 22/06/11 2:19 PM, Nick Sabalausky wrote:
>> In your example, the user needs to be able to use the Foo symbol in order
>> to
>> get full use out of Foos. However, in my example, the user does *not*
>> need
>> to use
On 22/06/11 2:19 PM, Nick Sabalausky wrote:
In your example, the user needs to be able to use the Foo symbol in order to
get full use out of Foos. However, in my example, the user does *not* need
to use the Foo symbol in order to get full use out of Bar. They can just use
Bar in place of Foo. The
On Wed, 22 Jun 2011 14:52:52 +0300, Peter Alexander
wrote:
// module A
private class Foo;
public alias Foo[] Foos;
// module B
void main()
{
Foos fs; // Legal? Seems so.
Foo f = fs[0]; // Clearly can't use Foo here, it's private.
auto f2 = fs[0]; // Legal?
fs[0].memFun();
"Peter Alexander" wrote in message
news:itsp16$1jl5$1...@digitalmars.com...
> On 22/06/11 1:41 PM, Nick Sabalausky wrote:
>> "Peter Alexander" wrote in message
>> news:itsl71$1cnq$1...@digitalmars.com...
>>> On 21/06/11 7:59 PM, Nick Sabalausky wrote:
"Peter Alexander" wrote in message
>>
On 22/06/11 1:41 PM, Nick Sabalausky wrote:
"Peter Alexander" wrote in message
news:itsl71$1cnq$1...@digitalmars.com...
On 21/06/11 7:59 PM, Nick Sabalausky wrote:
"Peter Alexander" wrote in message
news:itq945$2ag0$1...@digitalmars.com...
Is the following legal D?
// module A
private clas
"Peter Alexander" wrote in message
news:itsl71$1cnq$1...@digitalmars.com...
> On 21/06/11 7:59 PM, Nick Sabalausky wrote:
>> "Peter Alexander" wrote in message
>> news:itq945$2ag0$1...@digitalmars.com...
>>> Is the following legal D?
>>>
>>> // module A
>>> private class Foo;
>>> public alias Fo
On 21/06/11 7:59 PM, Nick Sabalausky wrote:
"Peter Alexander" wrote in message
news:itq945$2ag0$1...@digitalmars.com...
Is the following legal D?
// module A
private class Foo;
public alias Foo Bar;
// module B
import A;
Bar b; // I can't use Foo, but can I use Bar?
I'm adding module level
"Trass3r" wrote in message news:op.vxf267mf3ncmek@enigma...
> Or more precisely to disallow instantiation by the user and only provide a
> finite set of (nicer) methods.
Yea. I did something similar in an early draft of the "Dynamic Fallback"
example in my contest article (
http://www.semitwis
Or more precisely to disallow instantiation by the user and only provide a
finite set of (nicer) methods.
Using a templated alias to provide a cleaner public interface to a
private implementation that has a more complex interface).
Yep, I also used this feature to restrict instantiations for a template
function to a known finite set:
private void foo(alias func)()
{
...
func();
...
"Peter Alexander" wrote in message
news:itq945$2ag0$1...@digitalmars.com...
> Is the following legal D?
>
> // module A
> private class Foo;
> public alias Foo Bar;
>
> // module B
> import A;
> Bar b; // I can't use Foo, but can I use Bar?
>
>
> I'm adding module level protection for types into
On 2011-06-21 07:14, Peter Alexander wrote:
> Is the following legal D?
>
> // module A
> private class Foo;
> public alias Foo Bar;
>
> // module B
> import A;
> Bar b; // I can't use Foo, but can I use Bar?
>
>
> I'm adding module level protection for types into DMD and wondering if
> this sh
Is the following legal D?
// module A
private class Foo;
public alias Foo Bar;
// module B
import A;
Bar b; // I can't use Foo, but can I use Bar?
I'm adding module level protection for types into DMD and wondering if
this should be legal.
13 matches
Mail list logo