Go Back   Rhinocerus > Newsgroup > Newsgroup comp.lang.* 1 > Newsgroup comp.lang.rexx

Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 07-17-2012, 08:42 AM
Swifty
Guest
 
Posts: n/a
Default Sourceline(1) (Open Object REXX)

Line 1 of my program is: #!/usr/bin/rexx --

Sourceline(1) returns: --/usr/bin/rexx --

I can see that changing the "#!" to "--" makes life easier for the
interpreter, but shouldn't sourceline(1) return the first line of the
code?

My problem is that the program lists out all of the comments in the
first block of comments (i.e. from the first line starting with "--"
up to, but not including the next following line which does not start
with "--", and that value for line 1 is complicating my code.

In truth, I'm left with no way of knowing if line 1 really is a
comment, or a shebang line.

--
Steve Swift
http://www.swiftys.org.uk/swifty.html
http://www.ringers.org.uk
Reply With Quote
Alt Today
Advertising
 
and become member of Rhinocerus
Standard Sponsored Links

  #2 (permalink)  
Old 07-17-2012, 07:59 PM
Gerard_Schildberger
Guest
 
Posts: n/a
Default Re: Sourceline(1) (Open Object REXX)

On Tuesday, July 17, 2012 3:42:44 AM UTC-5, Swifty wrote:
> Line 1 of my program is: #!/usr/bin/rexx --
>
> Sourceline(1) returns: --/usr/bin/rexx --
>
> I can see that changing the "#!" to "--" makes life easier for the
> interpreter, but shouldn't sourceline(1) return the first line of the
> code?
>
> My problem is that the program lists out all of the comments in the
> first block of comments (i.e. from the first line starting with "--"
> up to, but not including the next following line which does not start
> with "--", and that value for line 1 is complicating my code.
>
> In truth, I'm left with no way of knowing if line 1 really is a
> comment, or a shebang line.
>
> --
> Steve Swift
> http://www.swiftys.org.uk/swifty.html
> http://www.ringers.org.uk


I just looked at the Regina PDF doc. It says that a Unix shell program would execute the program specified in the shebang line (also called a magic number) and pass the remainder of the lines in the file to this program via stdin. This implies that Regina wouldn't see the shebang line.

The implication (from above) is that the shebang line isn't part of the program. On my Windows systems, Regina and R4 considers the shebang line as part of the program, but ignores it for execution, and furthermore, SOURCELINE(1) is the shebang line.

This further implies that some REXXes (at least Regina and R4) are treatinga shebang line inconsistantly under different operating systems.
__________________________________________________ _________ Gerard Schildberger

Reply With Quote
  #3 (permalink)  
Old 07-18-2012, 06:48 AM
LesK
Guest
 
Posts: n/a
Default Re: Sourceline(1) (Open Object REXX)

On 7/17/2012 3:59 PM, Gerard_Schildberger wrote:
> On Tuesday, July 17, 2012 3:42:44 AM UTC-5, Swifty wrote:
>> Line 1 of my program is: #!/usr/bin/rexx --
>>
>> Sourceline(1) returns: --/usr/bin/rexx --
>>
>> I can see that changing the "#!" to "--" makes life easier for the
>> interpreter, but shouldn't sourceline(1) return the first line of the
>> code?
>>
>> My problem is that the program lists out all of the comments in the
>> first block of comments (i.e. from the first line starting with "--"
>> up to, but not including the next following line which does not start
>> with "--", and that value for line 1 is complicating my code.
>>
>> In truth, I'm left with no way of knowing if line 1 really is a
>> comment, or a shebang line.
>>
>> --
>> Steve Swift
>> http://www.swiftys.org.uk/swifty.html
>> http://www.ringers.org.uk

>
> I just looked at the Regina PDF doc. It says that a Unix shell program would execute the


program specified in the shebang line (also called a magic number) and
pass the remainder of

the lines in the file to this program via stdin. This implies that
Regina wouldn't see the

shebang line.
>
> The implication (from above) is that the shebang line isn't part of the program. On my


Windows systems, Regina and R4 considers the shebang line as part of
the program, but

ignores it for execution, and furthermore, SOURCELINE(1) is the
shebang line.
>
> This further implies that some REXXes (at least Regina and R4) are treating a shebang line


inconsistantly under different operating systems.
> __________________________________________________ _________ Gerard Schildberger
>
>

If Regina doesn't get to see the shebang line under Unix, then it isn't
"treating it differently".

People who use an OS that is designed around a 32 baud teletype as the
input/output device have to live with the consequences. :-)

Steve: You shot yourself in the foot by using a non-standard (neither
ANSI or TRL2) commenting technique.

--

Les (Change Arabic to Roman to email me)



Reply With Quote
  #4 (permalink)  
Old 07-18-2012, 01:00 PM
Jeremy Nicoll - news posts
Guest
 
Posts: n/a
Default Re: Sourceline(1) (Open Object REXX)

LesK <5mre20@tampabay.rr.com> wrote:

>On 7/17/2012 3:59 PM, Gerard_Schildberger wrote:
>> On Tuesday, July 17, 2012 3:42:44 AM UTC-5, Swifty wrote:
>>> Line 1 of my program is: #!/usr/bin/rexx --
>>>
>>> Sourceline(1) returns: --/usr/bin/rexx --


[snip]

> Steve: You shot yourself in the foot by using a non-standard (neither ANSI
> or TRL2) commenting technique.


I thought what he meant was that the first line in his file contains:

#!/usr/bin/rexx --

and that the interpreter had replaced the first two characters "#!" with
"--" as a simple way of making that line legal but ineffective. Does he
mean something else, do you think?

--
Jeremy C B Nicoll - my opinions are my own.

Email sent to my from-address will be deleted. Instead, please reply
to newsreplyaaa@wingsandbeaks.org.uk replacing "aaa" by "284".
Reply With Quote
  #5 (permalink)  
Old 07-18-2012, 06:03 PM
Swifty
Guest
 
Posts: n/a
Default Re: Sourceline(1) (Open Object REXX)

On Wed, 18 Jul 2012 02:48:40 -0400, LesK <5mre20@tampabay.rr.com>
wrote:

>Steve: You shot yourself in the foot by using a non-standard (neither
>ANSI or TRL2) commenting technique.


Ah, but my foot recovered, and was afterwards much improved, as it was
freed from worrying about nesting comments inside comments. :--)

--
Steve Swift
http://www.swiftys.org.uk/swifty.html
http://www.ringers.org.uk
Reply With Quote
  #6 (permalink)  
Old 07-18-2012, 06:05 PM
Swifty
Guest
 
Posts: n/a
Default Re: Sourceline(1) (Open Object REXX)

On Wed, 18 Jul 2012 14:00:49 +0100, Jeremy Nicoll - news posts
<jn.nntp.scrap007@wingsandbeaks.org.uk> wrote:

>Does he
>mean something else, do you think?


Well, *I* don't think that he means something else. I can't be 100%
sure though. Nothing is, these days.

See http://www.swiftys.org.uk/wiz?618 (the page built by a REXX CGI
script)

--
Steve Swift
http://www.swiftys.org.uk/swifty.html
http://www.ringers.org.uk
Reply With Quote
  #7 (permalink)  
Old 07-18-2012, 06:54 PM
Gerard_Schildberger
Guest
 
Posts: n/a
Default Re: Sourceline(1) (Open Object REXX)

On Wednesday, July 18, 2012 1:48:40 AM UTC-5, LesK wrote:
> On 7/17/2012 3:59 PM, Gerard_Schildberger wrote:
> &gt; On Tuesday, July 17, 2012 3:42:44 AM UTC-5, Swifty wrote:
> &gt;&gt; Line 1 of my program is: #!/usr/bin/rexx --
> &gt;&gt;
> &gt;&gt; Sourceline(1) returns: --/usr/bin/rexx --
> &gt;&gt;
> &gt;&gt; I can see that changing the &amp;quot;#!&amp;quot; to &amp;quot;--&amp;quot; makes life easier for the
> &gt;&gt; interpreter, but shouldn&amp;#39;t sourceline(1) return the first line of the
> &gt;&gt; code?
> &gt;&gt;
> &gt;&gt; My problem is that the program lists out all of the comments in the
> &gt;&gt; first block of comments (i.e. from the first line starting with &amp;quot;--&amp;quot;
> &gt;&gt; up to, but not including the next following line which does not start
> &gt;&gt; with &amp;quot;--&amp;quot;, and that value for line 1 is complicating my code.
> &gt;&gt;
> &gt;&gt; In truth, I&amp;#39;m left with no way of knowing if line 1 really is a
> &gt;&gt; comment, or a shebang line.
> &gt;&gt;
> &gt;&gt; --
> &gt;&gt; Steve Swift
> &gt;&gt; http://www.swiftys.org.uk/swifty.html
> &gt;&gt; http://www.ringers.org.uk
> &gt;
> &gt; I just looked at the Regina PDF doc. It says that a Unix shell program would execute the
>
> program specified in the shebang line (also called a magic number) and
> pass the remainder of
>
> the lines in the file to this program via stdin. This implies that
> Regina wouldn't see the
>
> shebang line.
> &gt;
> &gt; The implication (from above) is that the shebang line isn't partof the program. On my
>
> Windows systems, Regina and R4 considers the shebang line as part of
> the program, but
>
> ignores it for execution, and furthermore, SOURCELINE(1) is the
> shebang line.
> &gt;
> &gt; This further implies that some REXXes (at least Regina and R4) are treating a shebang line
>
> inconsistantly under different operating systems.
> &gt; __________________________________________________ _________ Gerard Schildberger
> &gt;
> &gt;
> If Regina doesn't get to see the shebang line under Unix, then it isn't
> &quot;treating it differently&quot;.
>
> People who use an OS that is designed around a 32 baud teletype as the
> input/output device have to live with the consequences. :-)
>
> Steve: You shot yourself in the foot by using a non-standard (neither
> ANSI or TRL2) commenting technique.
>
> --
>
> Les (Change Arabic to Roman to email me)


If Regina doesn't see the shebang line, it doesn't treat it at all, let alone deferently. If it DOES see it, then it apparently recognizes it as partof the REXX program (it thinks it's line #1), but ignores it (as if it were a comment).

As for the shebang being changed into a "-- comment": (apparently using open object REXX)"

I think you may have missed the point. The shebang line was changed by something, not the person who wrote the code. Note that SOURCELINE(1) returnsa line of text that isn't the original line of text. Note that I said text, not a REXX statement, as the shebang is not part of the REXX source program. It's not the first line of the REXX program [but which SOURCELINE(1) apparently thinks it is].
__________________________________________________ _______ Gerard Schildberger
Reply With Quote
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT. The time now is 02:19 PM.


Copyright ©2009

LinkBacks Enabled by vBSEO 3.3.0 RC2 © 2009, Crawlability, Inc.