Jump to page: 1 25  
Page
Thread overview
Import proposals
Jul 09, 2006
Regan Heath
Re: Import proposals (Discuss)
Jul 09, 2006
Regan Heath
Jul 10, 2006
Regan Heath
Jul 10, 2006
Tom S
Jul 10, 2006
John Reimer
Jul 10, 2006
Regan Heath
Jul 10, 2006
Ameer Armaly
Jul 10, 2006
Regan Heath
Jul 10, 2006
Tyro
Jul 10, 2006
Regan Heath
Jul 10, 2006
Tyro
Jul 10, 2006
Regan Heath
Jul 11, 2006
Regan Heath
Jul 12, 2006
Regan Heath
Jul 11, 2006
Tyro
Jul 12, 2006
Derek Parnell
Jul 12, 2006
Regan Heath
Jul 10, 2006
Derek Parnell
Jul 10, 2006
Rémy Mouëza
Re: Import proposals (Ideas)
Jul 09, 2006
Regan Heath
Jul 09, 2006
Regan Heath
Jul 10, 2006
Andrei Khropov
Jul 10, 2006
jcc7
Jul 10, 2006
jcc7
Jul 12, 2006
Anders Runesson
Jul 12, 2006
BCS
Jul 12, 2006
jcc7
Jul 12, 2006
BCS
Jul 12, 2006
Anders Runesson
Jul 12, 2006
jcc7
Jul 10, 2006
Dave
Jul 10, 2006
Oskar Linde
Jul 10, 2006
Dave
Jul 10, 2006
Bruno Medeiros
Jul 10, 2006
Regan Heath
Jul 10, 2006
Regan Heath
July 09, 2006
After reading the entire "Re: import concerns (was Re: Historical language survey)" thread and hearing all the different opinions I thought "we need a single place to put complete ideas" and "people should show support for the idea they like best"

So.. I'd like this thread to be that place. I'm going to post my own idea (in response to this post) and I'd like it if people to post their own ideas (or the ideas of others as they understand them) in complete form. Then I'd like people to show support for an idea that takes their fancy.

This is to give Walter an idea what ideas have community support.

If people want to discuss the ideas, I suggest we start a new thread, or a sub thread of this port specifically for discussion, as opposed to commenting in response to the ideas themselves.

This is generally just an attempt to get the discussion organised and to provide a reference we can refer back to at a later date. I have a threaded news group reader and this'll probably only look organised if you use one too, as opposed to the web interface. If you all think it's a terrible idea, I won't feel too hurt ;)

Regan

July 09, 2006
Sub-thread for discussions



July 09, 2006
Sub-thread for ideas.
July 09, 2006
This idea is broken into parts, other people might like to reference these parts in discussion or in their own ideas i.e. "using Regan's Part-A and .." etc.

--

Part-A:
import this.is.the.lib;

This imports all symbols from this.is.the.lib into the current scope. No changes to current import behaviour here. I have an alternate idea, not sure what people might think of this as it breaks all/most existing code but..

--

Alt-A:
import this.is.the.lib;
import this.is.the.lib as .;

So, import defaults to FQN and 'as' (properly introduced in Part-B below) must be used to import into the current scope (which is named '.')

--

Part-B:
import this.is.the.lib as x;

This imports all symbols from this.is.the.lib into named scope 'x'

--

Part-C:
import this.is.the.lib.copyFile,saveFile,deleteFile;

This imports the named symbols copyFile, saveFile, and deleteFile from this.is.the.lib into the current scope. The lib name is mentioned only once and therefore only one lib may be present in the import statement.

This idea may conflict with the current statement:
  import this.is.a.lib,this.is.another.lib;

which I've notice people use (but don't use personally).

The compiler can tell these apart by realising that the first part of the import denotes a symbol in a module, as opposed to a module itself. Then we have to ask ourselves, what if a module is later created by the name this.is.the.lib.copyFile .. I don't know, this is perhaps the most contrary part of my idea.

The advantage I see to this is that it only imports the symbols you want and to add a symbol you just add "," and the symbol name to the same line. So, it keeps the symbols from the same module together on one line/statement (which seems to me to be what people dislike about alias?) and does not involve needlessly repeating the module name.

--

Alt-C:
import this.is.the.lib.copyFile,saveFile,deleteFile;

This would import as FQN and not into the current scope (without use of 'as .' as shown in Part-D below).

--

Part-D:
import this.is.the.lib.copyFile,saveFile,deleteFile as x;

This imports the named symbols copyFile, saveFile, and deleteFile from this.is.the.lib into the named scope 'x'.

--

Part-E: (extension of Part-B)
import this.is.the.lib as this.is.the.lib;

This imports all the symbols from this.is.the.lib into the named scope 'this.is.the.lib' .. or in other words, this is an FQN import. My impression is that most people would rather not have FQN as the default, but do want it to be possible. My impression is that applying 'static' to import to achieve FQN import is disliked (I certainly dislike it). This seems a good compromise.

--

The complete idea/system combines all these parts. The "Alt" parts break existing code, the others shouldn't. The reasons for not simply using alias have been well hashed out already, from what I can see it's a maintenance and aesthetic request, as opposed to a truly functional improvement but that's reason enough for me to desire a change.

Regan
July 10, 2006
Regan Heath wrote:
> After reading the entire "Re: import concerns (was Re: Historical language survey)" thread and hearing all the different opinions I thought "we need a single place to put complete ideas" and "people should show support for the idea they like best"
> 
> So.. I'd like this thread to be that place. I'm going to post my own idea (in response to this post) and I'd like it if people to post their own ideas (or the ideas of others as they understand them) in complete form. Then I'd like people to show support for an idea that takes their fancy.
> 
> This is to give Walter an idea what ideas have community support.
> 
> If people want to discuss the ideas, I suggest we start a new thread, or a sub thread of this port specifically for discussion, as opposed to commenting in response to the ideas themselves.
> 
> This is generally just an attempt to get the discussion organised and to provide a reference we can refer back to at a later date. I have a threaded news group reader and this'll probably only look organised if you use one too, as opposed to the web interface. If you all think it's a terrible idea, I won't feel too hurt ;)
> 
> Regan
> 

I agree starting to migrate to a new thread might be useful (if everyone adheres to it), since the other is getting way nested! The most nested I've ever seen, some of the post are so far to right that no part of the title displays already Xp .
But I'm not so sure about dividing this thread into "discuss" and "ideas", people want to discuss ideas and proposals, it won't work well to divide them I think.

-- 
Bruno Medeiros - CS/E student
http://www.prowiki.org/wiki4d/wiki.cgi?BrunoMedeiros#D
July 10, 2006
Something that has just occured to me WRT "Part-C" of my idea.. the restriction of allowing only one module is probably un-necessary if we assume a rule;

* If a module is a single word i.e. "mylib" it comes at the start of an import statement, eg.

  import mylib;

or

  import mylib,my.other.lib.copyFile;

etc.. and never after a "," eg.

  import my.other.lib.copyFile,mylib;

(where "copyFile" is a symbol in "my.other.lib" and "mylib" is not)

So, this allows multiple modules in the same import statement even allowing you to import them into the same named scope, some examples:

  import my.other.lib.copyFile,deleteFile,your.lib.moveFile;

imports "copyFile" and "deleteFile" from "my.other.lib" and "moveFile" from "your.lib".

  import my.other.lib.copyFile,deleteFile,your.lib.moveFile as file;

imports "copyFile" and "deleteFile" from "my.other.lib" and "moveFile" from "your.lib" into named scope "file".

Thoughts?

Regan
July 10, 2006
On Mon, 10 Jul 2006 01:53:16 +0100, Bruno Medeiros <brunodomedeirosATgmail@SPAM.com> wrote:
> Regan Heath wrote:
>> After reading the entire "Re: import concerns (was Re: Historical language survey)" thread and hearing all the different opinions I thought "we need a single place to put complete ideas" and "people should show support for the idea they like best"
>>  So.. I'd like this thread to be that place. I'm going to post my own idea (in response to this post) and I'd like it if people to post their own ideas (or the ideas of others as they understand them) in complete form. Then I'd like people to show support for an idea that takes their fancy.
>>  This is to give Walter an idea what ideas have community support.
>>  If people want to discuss the ideas, I suggest we start a new thread, or a sub thread of this port specifically for discussion, as opposed to commenting in response to the ideas themselves.
>>  This is generally just an attempt to get the discussion organised and to provide a reference we can refer back to at a later date. I have a threaded news group reader and this'll probably only look organised if you use one too, as opposed to the web interface. If you all think it's a terrible idea, I won't feel too hurt ;)
>>  Regan
>>
>
> I agree starting to migrate to a new thread might be useful (if everyone adheres to it), since the other is getting way nested! The most nested I've ever seen, some of the post are so far to right that no part of the title displays already Xp .
> But I'm not so sure about dividing this thread into "discuss" and "ideas", people want to discuss ideas and proposals, it won't work well to divide them I think.

My reasoning is that our ideas ideas evolve/change over time and it'd be nice if each evolution was right next to the previous evolution. Seperating the discussion allows me to post an idea, be conviced by a discussion to change some part of it, or even come up with something independantly and post my changes in response to my original idea. This allows anyone to see at any time my complete idea/picture, something that I think often gets lost/confused in the course of a discussion.

That said, I'm happy to do whatever the community wants.. I've already posted and idea and opened a discussion on what I think is a contrary point in my idea .. we could see how it works and decide then perhaps?

Regan
July 10, 2006
I'd just like to make one more thing clear, when I say "my" idea I actually mean "your" ideas that I've stolen, thought about and combined into something I'm labelling "my" idea for ease of discussion :) So, it's only "my" idea in the sense that it's the idea (or bunch of ideas) I would use were it up to me.

Regan
July 10, 2006
Regan Heath wrote:
> Something that has just occured to me WRT "Part-C" of my idea.. the restriction of allowing only one module is probably un-necessary if we assume a rule;
> 
> * If a module is a single word i.e. "mylib" it comes at the start of an import statement, eg.
> 
>   import mylib;
> 
> or
> 
>   import mylib,my.other.lib.copyFile;
> 
> etc.. and never after a "," eg.
> 
>   import my.other.lib.copyFile,mylib;
> 
> (where "copyFile" is a symbol in "my.other.lib" and "mylib" is not)
> 
> So, this allows multiple modules in the same import statement even allowing you to import them into the same named scope, some examples:
> 
>   import my.other.lib.copyFile,deleteFile,your.lib.moveFile;
> 
> imports "copyFile" and "deleteFile" from "my.other.lib" and "moveFile" from "your.lib".
> 
>   import my.other.lib.copyFile,deleteFile,your.lib.moveFile as file;
> 
> imports "copyFile" and "deleteFile" from "my.other.lib" and "moveFile" from "your.lib" into named scope "file".
> 
> Thoughts?

Sorry, but I don't like it. I bet that every second coder new to the language would get totally confused by it.


-- 
Tomasz Stachowiak  /+ a.k.a. h3r3tic +/
July 10, 2006
"Regan Heath" <regan@netwin.co.nz> wrote in message news:optcf7kzem23k2f5@nrage...
> Something that has just occured to me WRT "Part-C" of my idea.. the restriction of allowing only one module is probably un-necessary if we assume a rule;
>
> * If a module is a single word i.e. "mylib" it comes at the start of an import statement, eg.
>
>   import mylib;
>
> or
>
>   import mylib,my.other.lib.copyFile;
>
> etc.. and never after a "," eg.
>
>   import my.other.lib.copyFile,mylib;
>
> (where "copyFile" is a symbol in "my.other.lib" and "mylib" is not)
>
> So, this allows multiple modules in the same import statement even allowing you to import them into the same named scope, some examples:
>
>   import my.other.lib.copyFile,deleteFile,your.lib.moveFile;
>
> imports "copyFile" and "deleteFile" from "my.other.lib" and "moveFile" from "your.lib".
>
>   import my.other.lib.copyFile,deleteFile,your.lib.moveFile as file;
>
> imports "copyFile" and "deleteFile" from "my.other.lib" and "moveFile" from "your.lib" into named scope "file".
>
> Thoughts?
>
IMO it's a bit confusing, and I can't see very many cases where it's particularly useful, but that could just be me.
> Regan


« First   ‹ Prev
1 2 3 4 5