Byte order mark is another can of worms, as is wide encoding. But, yes, currently, shebang handling on the J side relies on undefined verb parsing.
If we handle shebang lines, a question becomes: how much handling should be done? (For example, does #! become a comment prefix? In many interpreted languages, # marks the beginning of a comment which ends at line end.) (Also, if the J interpreter cannot find itself at the shebang path (delimited by a terminating space), should it pass control to that interpreter? This is how perl handles shebang lines...) Etc. -- Raul == Raul On Fri, Mar 10, 2023 at 10:46 AM Henry Rich <henryhr...@gmail.com> wrote: > > If we do that, should we revisit the question of ignoring the BOM (Byte > Order Mark) that editors sometimes put at the beginning of scripts? > > Does the shebang take advantage of the fact that the first line is > parsed into a bunch of undefined names taken to be a verb? Does that > mean that if username is 'monad', or any noun defined in the user's > profile, that the script will fail? > > If so, I think that should be changed. I would like to encourage users > to use 9!:55 to find garbage lines and they can't very well do that if > we depend on them. > > Is there a good reason not to ignore the shebang line explicitly, rather > than putting our faith in garbage processing? > > > Henry Rich > > On 3/10/2023 12:04 AM, Elijah Stone wrote: > > Perhaps it's simply time to tell the interpreter to start ignoring the > > first line of a script if it starts with #!... > > > > On Thu, 9 Mar 2023, Raul Miller wrote: > > > >> The recent change in directory naming from j903 to j9.4 introduces an > >> interesting issue for shell scripts on unix-like systems. > >> > >> In J shell scripts, this works: > >> > >> #!/home/username/j903/bin/jconsole > >> > >> However, this fails with a spelling error: > >> > >> #!/home/username/j9.4/bin/jconsole > >> > >> Or, on OSX, the shebang line is different, but the spelling error > >> remains: > >> > >> #!/Applications/j9.4/bin/jconsole > >> > >> That said, there's some other issues here, related to portability. One > >> of which is that (as a general rule) a home directory is personal > >> rather than portable. Another is that there's official java jconsole > >> which does not understand J. > >> > >> But, also, for a long time now, Debian based distributions have been > >> distributing j with /usr/bin/ijconsole as a symbolic link to the > >> current installed location for J. (Here, the 'i' in ijconsole stands > >> for Iverson.) > >> > >> So I think that now would be a good time to adopt that as "documented > >> standard practice" for j shell scripts. > >> > >> FYI, > >> > >> -- > >> Raul > >> ---------------------------------------------------------------------- > >> 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 ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm