| View previous topic :: View next topic |
| What should be the names of the standard- and user-library directories? (Regardless of the name, they are SEPARATE directories in two different locations.) |
| \Library |
|
10% |
[ 2 ] |
| \Lib |
|
42% |
[ 8 ] |
| \Include |
|
15% |
[ 3 ] |
| \Includes |
|
0% |
[ 0 ] |
| \Functions |
|
0% |
[ 0 ] |
| Different names even though they're in different locations |
|
31% |
[ 6 ] |
| Other |
|
0% |
[ 0 ] |
|
| Total Votes : 19 |
|
| Author |
Message |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10467
|
Posted: Sat Jun 16, 2007 12:37 am Post subject: Standard/User libraries for automatic function inclusion |
|
|
It is planned to distribute useful .ahk functions with AutoHotkey. To make the use of these "standard library functions" as convenient as possible, the plan is to automatically include a function from its external file whenever a script calls it by name (as long as the script doesn't already have a function of that name).
For example, if a script calls the function EncryptRC4() yet does not contain (or explicitly include) such a function, the file that matches the name of the function -- namely EncryptRC4.ahk -- would be automatically included from the user library or standard library.
The user library would be the directory such as My Documents\AutoHotkey\Library (exact name to be determined). This directory is purely optional: it would not get created by the installer. But if present, AutoHotkey would look there first for a match; if a match isn't found, it would then look in the standard library, which would be in the Library subfolder where AutoHotkey.exe is located.
Since the one-function-per-file approach would be cumbersome for its author to maintain when a feature-set has many functions, it was proposed that when a lookup fails to find an exact match, it should try to match just the prefix (if the function's name has a prefix). For example, if MyClass_Init.ahk doesn't exist but MyClass.ahk does, MyClass would be auto-included. Clearly this raises the possibility of naming collisions and ambiguity; but maybe the benefits are worth it.
Comments are welcome.
Last edited by Chris on Fri Jun 22, 2007 1:18 pm; edited 2 times in total |
|
| Back to top |
|
 |
engunneer
Joined: 30 Aug 2005 Posts: 6772 Location: Pacific Northwest, US
|
Posted: Sat Jun 16, 2007 2:04 am Post subject: |
|
|
I would prefer to set my own user library directory, and maybe even standard library, though that is not required.
Also, will/can AHK search all ahk files in the library for a function? or will it just go by file name?
which takes precedence, user or standard library?
perhaps the user library could be indicated in the script using #Library Path\To\Library?
Also, my "Other" vote - Lib and UserLib or just Lib for both. _________________
Unless otherwise noted, all code is untested.
Common Answers: 1.(Loops, Viruses, etc.) 2. Search 3.RTFM |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10467
|
Posted: Sat Jun 16, 2007 2:13 am Post subject: |
|
|
| engunneer wrote: | I would prefer to set my own user library directory
...
perhaps the user library could be indicated in the script using #Library Path\To\Library? | That is planned, but may be postponed because it doesn't affect the fact that a default location must be decided for the initial release.
| engunneer wrote: | | will/can AHK search all ahk files in the library for a function? or will it just go by file name? | Just the name.
| engunneer wrote: | | which takes precedence, user or standard library? | User (this was mentioned in the top post).
Thanks for voting. |
|
| Back to top |
|
 |
Laszlo
Joined: 14 Feb 2005 Posts: 4015 Location: Pittsburgh
|
Posted: Sat Jun 16, 2007 5:27 am Post subject: |
|
|
| I often make experimental versions of include files, and it is not a good idea to overwrite the standard include file. If the same directory is used, saving/renaming the standard include file was necessary, because explicit paths are more cumbersome (especially if I move the script or give it to someone). Also, batch renaming or other cleanup operations are often performed in our own include directory, which should not touch the standard library, otherwise some other scripts might stop working. Therefore, different directory names are safer and more convenient. I voted for StdLib/UserLib. |
|
| Back to top |
|
 |
toralf
Joined: 31 Jan 2005 Posts: 3842 Location: Bremen, Germany
|
Posted: Sat Jun 16, 2007 6:30 am Post subject: |
|
|
voted StdLib/UserLib _________________ Ciao
toralf  |
|
| Back to top |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 5884
|
Posted: Sat Jun 16, 2007 8:25 am Post subject: |
|
|
I voted: \Stdlib and \Userlib  |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10467
|
Posted: Sat Jun 16, 2007 11:53 am Post subject: |
|
|
I should clarify that the directories are separate even if they have the same name. For example:
| Code: | C:\Program Files\AutoHotkey\Library\ ; The standard library.
C:\...\My Documents\AutoHotkey\Library\ ; The user library. | Since many of the votes probably have this misunderstanding, I've reset the poll. |
|
| Back to top |
|
 |
majkinetor
Joined: 24 May 2006 Posts: 3626 Location: Belgrade
|
Posted: Sat Jun 16, 2007 1:30 pm Post subject: |
|
|
I voted: \Stdlib and \Userlib
This directories should be named differently as I will definitely keep them on the same place. _________________
 |
|
| Back to top |
|
 |
Laszlo
Joined: 14 Feb 2005 Posts: 4015 Location: Pittsburgh
|
Posted: Sat Jun 16, 2007 2:59 pm Post subject: |
|
|
| Even if the directories are in different locations, it is better to name them differently, so that they cannot be mistaken to each other, when someone explores the directory tree. Some file managers show only the end of the current path, which ought to be enough to distinguish between user- and standard libraries, not to accidentally change files in the wrong place. |
|
| Back to top |
|
 |
corrupt
Joined: 29 Dec 2004 Posts: 2397
|
Posted: Sat Jun 16, 2007 3:44 pm Post subject: |
|
|
| Laszlo wrote: | | Even if the directories are in different locations, it is better to name them differently, so that they cannot be mistaken to each other, when someone explores the directory tree. Some file managers show only the end of the current path, which ought to be enough to distinguish between user- and standard libraries, not to accidentally change files in the wrong place. | 99% of users will have enough intelligence to check above the initial directory to see which directory they are in and I doubt that it will be typical for anyone to be in the Standard path anyway. If I understood correctly, the Standard library will eventually contain files that get distributed with AutoHotkey that are approved by the development team of one. The User path would be designated for changes, additions, etc.. made by a user. Besides, if you navigate to a directory then why wouldn't you know where you are? If a script has opened the directory for you then the script should know the path that it opened...
I voted for /Include for both since it seems to make sense since the files would be #Included. This makes the action that is being performed obvious. Keeping the same sub directory name would make things consistent.
On the other hand, since a lot of recent discussion led to the highly intelligent names NumGet and NumPut, I wouldn't be surprised if the directories get named something like "AsciiAppendRepository" and "MyDogHasPurpleFleas". |
|
| Back to top |
|
 |
majkinetor
Joined: 24 May 2006 Posts: 3626 Location: Belgrade
|
Posted: Sat Jun 16, 2007 4:12 pm Post subject: |
|
|
| Quote: | | 99% of users will have enough intelligence |
This has nothing to do with intelegence. The folders should be named differently to signify the different role they present in the system.
Also, the same name makes them not able to exist in the single place. I would certanly keep them on the same place as I don't use stupid general places. My setup is portable. I don't depend on MS standards nor I want to. _________________

Last edited by majkinetor on Sat Jun 16, 2007 4:15 pm; edited 1 time in total |
|
| Back to top |
|
 |
corrupt
Joined: 29 Dec 2004 Posts: 2397
|
Posted: Sat Jun 16, 2007 4:14 pm Post subject: |
|
|
| majkinetor wrote: | | Quote: | | 99% of users will have enough intelligence |
This has nothing to do with intelegence. The folders should be named differently. | why? They have the same purpose. Aren't you always the one preaching about standards? Why do they need different sub-directory names? It will only tend to confuse people and/or make them guess wrong based on the Standard Library directory name when creating a User directory (since it will not be created by default - I disagree with that also...). |
|
| Back to top |
|
 |
majkinetor
Joined: 24 May 2006 Posts: 3626 Location: Belgrade
|
Posted: Sat Jun 16, 2007 4:17 pm Post subject: |
|
|
| Quote: | | They have the same purpose |
They don't have the same purpose although it seems so.
Like I said, I would like to keep them in the same root.
FFS, why should we name them the same, its more limiting and there are no benefits of that comparing to different name scenario. _________________
 |
|
| Back to top |
|
 |
corrupt
Joined: 29 Dec 2004 Posts: 2397
|
Posted: Sat Jun 16, 2007 4:22 pm Post subject: |
|
|
| majkinetor wrote: | | Quote: | | They have the same purpose |
They don't have the same purpose although it seems so.
Like I said, I would like to keep them in the same root. | Keeping the directories in the same root will not be possible unless an option is added to let a user specify the directory path. If specifying the path was possible then you could choose any name for the directory in any path anyway. That's not what we are discussing. |
|
| Back to top |
|
 |
majkinetor
Joined: 24 May 2006 Posts: 3626 Location: Belgrade
|
Posted: Sat Jun 16, 2007 4:30 pm Post subject: |
|
|
If I can not put them where I want, this is stupid, I want even discuss it. _________________
 |
|
| Back to top |
|
 |
|