On Tue, Feb 28, 2012 at 8:43 AM, Keshav Kini <keshav.k...@gmail.com> wrote:
> On Tue, Feb 28, 2012 at 23:54, Michael Orlitzky <mich...@orlitzky.com> wrote:
>> On 02/27/12 15:51, R. Andrew Ohana wrote:
>> > 2) The standard solution has been brought up, and I think it is decent
>> > one; we use an escape mode with a double dash (e.g. sage --
>> > some_script.sage).
>>
>> This should probably be the fallback after either,
>>
>>  a) don't try to execute things that are subcommands
>>  b) don't treat as subcommands files which exist
>>
>> fails.
>
> It's not actually a fallback for b), though. If a file does exist with
> the same name as a subcommand, b) makes it impossible to use that
> subcommand without changing directory or deleting/moving the file. One
> might say that in such cases we should do `sage foo` to execute the
> file foo and `sage foo --` to execute the subcommand, but this means
> you are no longer allowed to pass $@ along to the .sage file without
> snooping it, which is an ugly situation.

You would do "sage foo.sage".  It seems like you're ignoring that
files end in .py, .pyx, .sage, and no commands end in those
extensions.  I don't see how there will ever be a conflict.

>
> IMO subcommands should always take precedence over filenames. `sage --
> filename` should be the standard way to run .sage files.

I disagree, since filename is really filename.sage.

>
> Or we could just ditch subcommands altogether.

I do like subcommands...

> Or we could have a separate subcommand for running scripts, say `sage
> run <foo>`, which seems to fit in nicely with subcommands representing
> different actions, though it's less backwards-compatible than the
> other options. I like this last option the most, I think. It avoids
> hairy parsing behavior and corner cases, as far as I can see.
>
> -Keshav
>
> ----
> Join us in #sagemath on irc.freenode.net !
>
> --
> To post to this group, send an email to sage-devel@googlegroups.com
> To unsubscribe from this group, send an email to 
> sage-devel+unsubscr...@googlegroups.com
> For more options, visit this group at 
> http://groups.google.com/group/sage-devel
> URL: http://www.sagemath.org



-- 
William Stein
Professor of Mathematics
University of Washington
http://wstein.org

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to