Re: [Jgeneral] Folders and Projects
chris burke writes: >> Is it mandatory, that project directories are children of the >> folders specified in UserFolders_j_? Or is it at least discouraged >> to create a J project in an arbitrary > directory which is not part of the folder hierarchy already known to J? > > You can create a project anywhere you like, but lose the benefit of > Folders if your project is not under a Folder. > >> Or, to put it in another way: What is the recommended way to create >> a J project in a directory outside of the >> /home/user/j9.4-user/projects hierarchy? > > Create a Folder name for your directory (Edit|Configure|Folders). > Restart J, then Project|New. Alternatively, just create a directory > under your Folder and add an empty .jproj file with that name. Hi Chris, thank you very much for your comprehensive reply. I think, it now makes sense to me! Regards, Thomas -- For information about J forums see http://www.jsoftware.com/forums.htm
Re: [Jgeneral] Folders and Projects
Also you provide a mechanism to package projects as a single script. That's one of the things which distinguishes a project directory from some other directory. -- Raul On Sat, Mar 4, 2023 at 11:30 AM chris burke wrote: > > Folders and Projects are just convenient ways to name and navigate > through directories. This helps you organize your code, particularly > when using Jqt. It also helps when sharing code with someone else who > may use a different directory structure, since they need only define > Folder names to match their directories, otherwise no change is needed > to the source code. > > A Folder is a short name for a directory, and Project is a > subdirectory of a Folder with a .jproj file. Typically you create a > Folder for any new system, and Projects under that Folder for its > various components. > > For example, on my machine > >jpath '~Sqlite'NB. a folder name > /home/chris/dev/apps/sqlite/source > >dir jpath '~Sqlite/base' NB. a project under that folder > api.ijs 1947 27-Aug-18 12:29:08 > base.jproj 114 24-May-18 12:18:49 > build.ijs 50 30-Apr-18 07:42:27 > info.ijs 399 30-Apr-18 07:42:27 > ... > > The examples in the wiki should give you the idea. > > As regards your questions: > > > Is it mandatory, that project directories are children of the folders > > specified in UserFolders_j_? Or is it at least discouraged to create a J > > project in an arbitrary > directory which is not part of the folder hierarchy already known to J? > > You can create a project anywhere you like, but lose the benefit of > Folders if your project is not under a Folder. > > > Or, to put it in another way: What is the recommended way to create a J > > project in a directory outside of the /home/user/j9.4-user/projects > > hierarchy? > > Create a Folder name for your directory (Edit|Configure|Folders). > Restart J, then Project|New. Alternatively, just create a directory > under your Folder and add an empty .jproj file with that name. > > On Sat, Mar 4, 2023 at 4:32 AM Thomas Bulka > wrote: > > > > Hi Forum, > > > > I studied the guide about folders and projects in the wiki and it kind > > of confused me > > (https://code.jsoftware.com/wiki/Guides/Folders_and_Projects). > > > > It says "A project is a subdirectory of a folder that contains a file > > with extension .jproj with the same name as the directory." Fine. > > > > Folders have been introduced together with the nouns SystemFolder_j_ and > > UserFolders_j_ which J creates upon installation. Also fine. > > > > I'm not sure about the conclusion, though. Is it mandatory, that project > > directories are children of the folders specified in UserFolders_j_? Or > > is it at least discouraged to create a J project in an arbitrary > > directory which is not part of the folder hierarchy already known to J? > > > > Or, to put it in another way: What is the recommended way to create a J > > project in a directory outside of the /home/user/j9.4-user/projects > > hierarchy? > > > > Sorry for this most likely trivial question, but somehow I'm not able to > > figure out the connection between folders and directories. > > > > Thanks in advance! > > > > Regards, > > > > Thomas > > -- > > For information about J forums see http://www.jsoftware.com/forums.htm > -- > For information about J forums see http://www.jsoftware.com/forums.htm -- For information about J forums see http://www.jsoftware.com/forums.htm
Re: [Jgeneral] Folders and Projects
Folders and Projects are just convenient ways to name and navigate through directories. This helps you organize your code, particularly when using Jqt. It also helps when sharing code with someone else who may use a different directory structure, since they need only define Folder names to match their directories, otherwise no change is needed to the source code. A Folder is a short name for a directory, and Project is a subdirectory of a Folder with a .jproj file. Typically you create a Folder for any new system, and Projects under that Folder for its various components. For example, on my machine jpath '~Sqlite'NB. a folder name /home/chris/dev/apps/sqlite/source dir jpath '~Sqlite/base' NB. a project under that folder api.ijs 1947 27-Aug-18 12:29:08 base.jproj 114 24-May-18 12:18:49 build.ijs 50 30-Apr-18 07:42:27 info.ijs 399 30-Apr-18 07:42:27 ... The examples in the wiki should give you the idea. As regards your questions: > Is it mandatory, that project directories are children of the folders > specified in UserFolders_j_? Or is it at least discouraged to create a J > project in an arbitrary directory which is not part of the folder hierarchy already known to J? You can create a project anywhere you like, but lose the benefit of Folders if your project is not under a Folder. > Or, to put it in another way: What is the recommended way to create a J > project in a directory outside of the /home/user/j9.4-user/projects hierarchy? Create a Folder name for your directory (Edit|Configure|Folders). Restart J, then Project|New. Alternatively, just create a directory under your Folder and add an empty .jproj file with that name. On Sat, Mar 4, 2023 at 4:32 AM Thomas Bulka wrote: > > Hi Forum, > > I studied the guide about folders and projects in the wiki and it kind > of confused me > (https://code.jsoftware.com/wiki/Guides/Folders_and_Projects). > > It says "A project is a subdirectory of a folder that contains a file > with extension .jproj with the same name as the directory." Fine. > > Folders have been introduced together with the nouns SystemFolder_j_ and > UserFolders_j_ which J creates upon installation. Also fine. > > I'm not sure about the conclusion, though. Is it mandatory, that project > directories are children of the folders specified in UserFolders_j_? Or > is it at least discouraged to create a J project in an arbitrary > directory which is not part of the folder hierarchy already known to J? > > Or, to put it in another way: What is the recommended way to create a J > project in a directory outside of the /home/user/j9.4-user/projects > hierarchy? > > Sorry for this most likely trivial question, but somehow I'm not able to > figure out the connection between folders and directories. > > Thanks in advance! > > Regards, > > Thomas > -- > For information about J forums see http://www.jsoftware.com/forums.htm -- For information about J forums see http://www.jsoftware.com/forums.htm
Re: [Jgeneral] Folders and Projects
That's an interesting question, and I guess it boils down to "how does the interpreter locate relevant .jproj files"? If I look at all of J's .ijs files for those which reference '.jproj' one in particular stands out: stdlib.ijs And, if I look at J's system/main/stdlib.ijs for how .jproj gets referenced, I see: ProjExt=: '.jproj' and p=. (, '/' , ProjExt ,~ spath) each subdirtree y Studying these clues in stdlib.ijs, the names I see being used here are: FolderIds FolderTree getfolderdefs setfolder And that's as far as it goes there. But they're also used in system/util/project.ijs and presumably it's also possible to use an absolute path to reference a project. I see two verbs mentioned which presumably take a project reference -- when I look at https://code.jsoftware.com/wiki/Guides/Folders_and_Projects#Project_Verbs -- but the single example there does not take advantage of the above FolderTree (or FolderIds) structure. So, I would guess that the enumeration of projects under system and user folders is mostly only for the J IDE. In jqt, that would be the Project > Open menu option. (And, in that Project menu, 'New' should probably be 'New...' and 'Open' should probably be 'Open...' as traditionally we put a trailing ellipsis on menu options which bring up a dialog). Or, to make a long story short: If you want to open a project from the J IDE, you'll need to put it under a folder which J manages. -- Raul On Sat, Mar 4, 2023 at 7:32 AM Thomas Bulka wrote: > > Hi Forum, > > I studied the guide about folders and projects in the wiki and it kind > of confused me > (https://code.jsoftware.com/wiki/Guides/Folders_and_Projects). > > It says "A project is a subdirectory of a folder that contains a file > with extension .jproj with the same name as the directory." Fine. > > Folders have been introduced together with the nouns SystemFolder_j_ and > UserFolders_j_ which J creates upon installation. Also fine. > > I'm not sure about the conclusion, though. Is it mandatory, that project > directories are children of the folders specified in UserFolders_j_? Or > is it at least discouraged to create a J project in an arbitrary > directory which is not part of the folder hierarchy already known to J? > > Or, to put it in another way: What is the recommended way to create a J > project in a directory outside of the /home/user/j9.4-user/projects > hierarchy? > > Sorry for this most likely trivial question, but somehow I'm not able to > figure out the connection between folders and directories. > > Thanks in advance! > > Regards, > > Thomas > -- > For information about J forums see http://www.jsoftware.com/forums.htm -- For information about J forums see http://www.jsoftware.com/forums.htm
[Jgeneral] Folders and Projects
Hi Forum, I studied the guide about folders and projects in the wiki and it kind of confused me (https://code.jsoftware.com/wiki/Guides/Folders_and_Projects). It says "A project is a subdirectory of a folder that contains a file with extension .jproj with the same name as the directory." Fine. Folders have been introduced together with the nouns SystemFolder_j_ and UserFolders_j_ which J creates upon installation. Also fine. I'm not sure about the conclusion, though. Is it mandatory, that project directories are children of the folders specified in UserFolders_j_? Or is it at least discouraged to create a J project in an arbitrary directory which is not part of the folder hierarchy already known to J? Or, to put it in another way: What is the recommended way to create a J project in a directory outside of the /home/user/j9.4-user/projects hierarchy? Sorry for this most likely trivial question, but somehow I'm not able to figure out the connection between folders and directories. Thanks in advance! Regards, Thomas -- For information about J forums see http://www.jsoftware.com/forums.htm