View mode: basic / threaded / horizontal-split · Log in · Help
March 31, 2005
Re: Phobos: The Final Tally
David Barrett wrote:
> "Mike Parker" <aldacron71@yahoo.com> wrote in message 
> news:d2e013$qls$1@digitaldaemon.com...
> 
...
> That's a fair comment.  Would you support renaming the "std" namespace to be 
> "phobos"?
> 
> I think it's that discrepancy that bothers me the most.  It's like "Hi, my 
> name is David, spelled B-O-B".

I made that very suggestion a couple years ago (before we had even had 
the std package). It was an idea ahead of its time. :)
http://www.digitalmars.com/drn-bin/wwwnews?D/18412

The idea of calling phobos "phobos" still makes an immense amount of 
sense to me, but I've pretty much given the argument. Just because it's 
obvious to me doesn't guarantee that anyone else will agree with my 
logic. ;)

> Given that changing "std" would break a lot of code and changing "Phobos" 
> would break almost none, I favor changing Phobos, though I'd be happy with 
> either.

Renaming "std" would be a problem easily solved with "Find and Replace", 
but the powers-that-be are happy with most of Phobos in the "std" 
package (with the rest in etc.*, internal.*, and a few hanging around 
without a package), so that's how it'll remain for the immediate future. 
At least the folder is called "phobos".

-- 
jcc7
http://jcc_7.tripod.com/d/
March 31, 2005
Re: Phobos: Renaming, Reorganizing, etc...
"Derek Parnell" <derek@psych.ward> wrote in message 
news:tkxprbvhzw3r.126jttcaxfh3d$.dlg@40tude.net...
> On Wed, 30 Mar 2005 13:56:54 -0800, Walter wrote:
>
>> "Carlos Santander B." <csantander619@gmail.com> wrote in message
>> news:d2f4dj$236r$7@digitaldaemon.com...
>>> I think he means the inability (sp?) of doing this:
>>>
>>> /some/path/mylibrary.d
>>> /some/path/mylibrary/foo.d
>>> /some/path/mylibrary/bar.d
>>
>> To make that work would introduce a huge kludge into the symbol table 
>> lookup
>> rules, as mylibrary would have to be *both* a module name and a package
>> name, and disambiguating the two cases would likely be an endless source 
>> of
>> weird bugs. It'd be like trying to make:
>>
>>     int foo;
>>     void foo();
>>
>> work.
>
> You slacker! ;-) What a cop out...

I think he means it would be a source of user bugs - not compiler bugs. For 
example it would be impossible to tell if, for example, "mylibrary.foo.x" 
means "package mylibrary module foo class x" or "module mylibrary class foo 
field x". There would be no way for the user to specify which they meant. 
One might be tempted to say "use an alias" but the alias would say something 
like "alias mylibrary.foo bar" which does not help. So the language would 
need reworking - most likely by using a different token to distinguish 
between field access and package access and maybe other kinds of access (eg 
mylibrary::foo.x). Needless to say that would be a big change.
March 31, 2005
Re: Phobos: Renaming, Reorganizing, etc...
"Ben Hinkle" <ben.hinkle@gmail.com> wrote in message
news:d2fi69$2gbj$1@digitaldaemon.com...
> I think he means it would be a source of user bugs - not compiler bugs.

It'd be a source of bugs for both.

> For
> example it would be impossible to tell if, for example, "mylibrary.foo.x"
> means "package mylibrary module foo class x" or "module mylibrary class
foo
> field x". There would be no way for the user to specify which they meant.
> One might be tempted to say "use an alias" but the alias would say
something
> like "alias mylibrary.foo bar" which does not help. So the language would
> need reworking - most likely by using a different token to distinguish
> between field access and package access and maybe other kinds of access
(eg
> mylibrary::foo.x). Needless to say that would be a big change.

Consider the kludge-o-matic means C++ uses to distinguish struct names from
other names with the same spelling. I was hoping to leave all that behind
<g>.
March 31, 2005
Re: Phobos: Renaming, Reorganizing, etc...
> This last one was the most dissapointing thing to me when learning D. I
> feel like my code has to be organized in a way that I do not prefer, and
> when a language takes that freedom from a programmer, that is a bad thing.

I agree, but what I hate even more is when I am forced to use God-hated JAVA
code-style ( variableNames , methodNames() , ...) . IMHO D's standard
library - Phobos should follow STD C naming scheme and use simple
method_names() ... Who knows, maybe D's community is full of JAVA
programmers... Than I would understand current D direction.

-- 
...........
Dejan Lekic
 http://dejan.lekic.org
March 31, 2005
Re: Phobos: Renaming, Reorganizing, etc...
"Derek Parnell" <derek@psych.ward> wrote in message
news:hmt0w1vqr6kt$.sb6zy77ta9k4.dlg@40tude.net...
> I does seem odd to me too that DMD disallows a source file to have the
same
> basic name as the directory its in. The file system handles this quite
well
> so why DMD doesn't is still a mystery to me.

I agree with the rest of your post. But the file system doesn't handle it at
all. No file system I know of allows both a file and a directory to have the
same name. Try creating a file named 'foo' and a subdirectory 'foo' at the
same time!
March 31, 2005
Re: Phobos: Renaming, Reorganizing, etc...
Walter wrote:
> 
> I agree with the rest of your post. But the file system doesn't handle it at
> all. No file system I know of allows both a file and a directory to have the
> same name. Try creating a file named 'foo' and a subdirectory 'foo' at the
> same time!
> 

foo.d = file
foo = dir

These do NOT have the same name.. I have no idea why you posted that...

Thanks
Trevor Parscal
www.trevorparscal.com
March 31, 2005
Re: Phobos: Renaming, Reorganizing, etc...
On Wed, 30 Mar 2005 18:23:30 -0800, Walter wrote:

> "Derek Parnell" <derek@psych.ward> wrote in message
> news:hmt0w1vqr6kt$.sb6zy77ta9k4.dlg@40tude.net...
>> I does seem odd to me too that DMD disallows a source file to have the
> same
>> basic name as the directory its in. The file system handles this quite
> well
>> so why DMD doesn't is still a mystery to me.
> 
> I agree with the rest of your post. But the file system doesn't handle it at
> all. No file system I know of allows both a file and a directory to have the
> same name. Try creating a file named 'foo' and a subdirectory 'foo' at the
> same time!

I'm sorry I didn't highlight the important word in my post. See how I said
"*basic* name" and not "file name". By that I meant the file name excluding
the 'extension' portion. Sorry I didn't make that clearer. So what I meant
was 'foo.d' is allowed inside a directory called 'foo'.

-- 
Derek
Melbourne, Australia
31/03/2005 12:50:59 PM
March 31, 2005
Re: Phobos: Renaming, Reorganizing, etc...
On Thu, 31 Mar 2005 12:53:42 +1000, Derek Parnell wrote:

> On Wed, 30 Mar 2005 18:23:30 -0800, Walter wrote:
> 
>> "Derek Parnell" <derek@psych.ward> wrote in message
>> news:hmt0w1vqr6kt$.sb6zy77ta9k4.dlg@40tude.net...
>>> I does seem odd to me too that DMD disallows a source file to have the
>> same
>>> basic name as the directory its in. The file system handles this quite
>> well
>>> so why DMD doesn't is still a mystery to me.
>> 
>> I agree with the rest of your post. But the file system doesn't handle it at
>> all. No file system I know of allows both a file and a directory to have the
>> same name. Try creating a file named 'foo' and a subdirectory 'foo' at the
>> same time!
> 
> I'm sorry I didn't highlight the important word in my post. See how I said
> "*basic* name" and not "file name". By that I meant the file name excluding
> the 'extension' portion. Sorry I didn't make that clearer. So what I meant
> was 'foo.d' is allowed inside a directory called 'foo'.

Oops, pressed send to quickly (again).

So what I meant was 'foo.d' is allowed along side a directory called 'foo'.
-- 
Derek
Melbourne, Australia
31/03/2005 12:55:55 PM
March 31, 2005
Re: Phobos: What's in a name?
"Regan Heath" <regan@netwin.co.nz> wrote in message
news:opsog6g1f323k2f5@nrage.netwin.co.nz...
> At the present time:
> 1. D's compiler has bugs, stopping me from writing my/a library.

Which bug(s) in particular?
March 31, 2005
Re: Phobos: What's in a name?
On Wed, 30 Mar 2005 18:47:11 -0800, Walter <newshound@digitalmars.com>  
wrote:
> "Regan Heath" <regan@netwin.co.nz> wrote in message
> news:opsog6g1f323k2f5@nrage.netwin.co.nz...
>> At the present time:
>> 1. D's compiler has bugs, stopping me from writing my/a library.
>
> Which bug(s) in particular?

Actually I just discovered today that my bug, might not be a bug, but a  
known limitation, specifically:

http://www.digitalmars.com/d/template.html

Limitations
Templates cannot be used to add non-static members or functions to  
classes. For example:

class Foo
{
    template TBar(T)
    {
T xx;// Error
int func(T) { ... }// Error

static T yy;// Ok
static int func(T t, int y) { ... } // Ok
    }
}

I was trying to use templates to write various operator overloads. See:
http://www.digitalmars.com/drn-bin/wwwnews?digitalmars.D.bugs/3213

I was doing this for a BitArray class to replace bit[] due to the problems  
I had with it, see my post:
http://www.digitalmars.com/drn-bin/wwwnews?digitalmars.D.bugs/3210

Another I found in that 'session' of coding:
http://www.digitalmars.com/drn-bin/wwwnews?digitalmars.D.bugs/3214

On the grand sceme of things my little BitArray library/module/thing  
probably isn't the most important piece of work going on in D at the  
moment. It's just, well, every time I go to write something in D I hit  
these sorts of bugs or limitations. It's disheartening, but, I'm patient  
and not what you'd call serious about development in D (yet) so I can  
handle it.

Regan
1 2 3 4 5 6 7 8
Top | Discussion index | About this forum | D home