[clean-script shebang] Anyone fixed clean-script.r for shebang lines?
[1/7] from: gregg::pointillistic::com at: 22-Feb-2008 15:06
Has anyone fixed %clean-script.r so it doesn't alter shebang lines? It
sees the line as an issue!, refinements!, etc. %clean-script-heavy.r
does the same thing.
--Gregg
[2/7] from: gregg::pointillistic::com at: 23-Feb-2008 21:49
> Has anyone fixed %clean-script.r so it doesn't alter shebang lines? It
> sees the line as an issue!, refinements!, etc. %clean-script-heavy.r
> does the same thing.
My simple fix for now is to do this before the SOME in the parse rule:
opt [str: "#!" thru newline new: (emit str new)]
Doesn't work if you have newlines before the shebang, but you shouldn't
do that anyway, right?
--Gregg
[3/7] from: Tom::Conlin::gmail::com at: 24-Feb-2008 1:15
why don't you skip to rebol-header?
everything before the header is a comment
as far a rebol is concerned anyway
and yes sometimes I do take advantage of that.
Gregg Irwin wrote:
[4/7] from: gregg::pointillistic::com at: 24-Feb-2008 15:20
Hi Tom,
T> why don't you skip to rebol-header?
T> everything before the header is a comment as far a rebol is
T> concerned anyway and yes sometimes I do take advantage of that.
It could do that too. I used to put stuff before the header, but I got
out of that habit as it seemed to add more clutter that "hid" the
code, even though I could bundle more info in a script that way.
Does anyone else do that? Do you think it helps or hurts, when other
people look at things? For example, would you rather have a single %.r
file with readme notes, tests, docs, etc., or separate files and just
code
in scripts?
-- Gregg
[5/7] from: Tom:Conlin:g:mail at: 24-Feb-2008 21:43
I suppose it depends on the nature of what you do.
If I am aspiring to write a large reusable library,
then code and doc etc separate.
If you are solving someone else's a one off problem
fast then bundling it in a single file is what I do.
If I get sent a decent problem specification I may just begin
coding beneath that as it keeps the script bundled with it's context.
If there is data in the file I am apt to put a block around it and
use it place.
Gregg Irwin wrote:
[6/7] from: sqlab::gmx::net at: 25-Feb-2008 8:30
Hi Gregg,
normally I put a list of things still to do or unresolved issues before
the header.
I remember even once modifying the SDK preprocessor, as it could not
deal with that.
AR
Gregg Irwin wrote:
[7/7] from: gregg::pointillistic::com at: 25-Feb-2008 10:15
> normally I put a list of things still to do or unresolved issues
> before
> the header.
I often put notes like that in the header.
Ultimately, I think it's a good thing to support, given REBOL's
messaging
nature, but it needs to *be* supported. That means %clean-script
should be
modded per Tom's suggestion.
What about changing how OUT is set before the parse. Something like
this maybe:
out: clear copy script
append out rejoin [newline trim copy/part script find script "REBOL ["]
script: find script "REBOL ["
Then the parse rule stays as it was originally.
--Gregg