mit-scheme-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MIT-Scheme-devel] Newbie: Compiling and commandline args


From: Chris Hanson
Subject: Re: [MIT-Scheme-devel] Newbie: Compiling and commandline args
Date: Wed, 15 May 2019 15:48:16 -0700

In that case, command-line-arguments is probably what you want. It will include the strings for all of the arguments after --load <filename>.

On Wed, May 15, 2019 at 3:18 PM Peter Wiehe <address@hidden> wrote:
Well I am misunderstood here. The manual and your answer are about commandline args of Scheme in general. I am about args specifially for the program (script). That's a big difference.

I tried to find answers on the web and in the MIT/GNU Scheme docu and in books. The existing texts (online and offline) are a great deal less informative than in other languages like C or pretty much any other language. So I have tried to find a solution by experimenting but that doesn't get me far. So I have to ask newb questions. If I ever get a hang on Scheme I would be pleased to write some tutorial.

Kind regards
Peter

Chris Hanson <address@hidden> schrieb am Do., 16. Mai 2019 00:04:
Please read the manual before asking this kind of question. Both your question about the command line, and the other about compiling files, are answered in the User's Manual.

The advice to use command-line-arguments is not useful here, because that will only contain unknown arguments. Since --load is a known argument, it won't appear in that list.

In any case it's not clear why you want to look at the command-line args in the first place. The --load argument is used to load a file of Scheme code; it has nothing to do with compilation.

On Wed, May 15, 2019 at 2:02 PM Peter Wiehe <address@hidden> wrote:
Am 15.05.19 um 14:22 schrieb Aaron S. Hawley:
> On Wed, May 15, 2019 at 7:14 AM Peter Wiehe<address@hidden>  wrote:
>> How do I access the commandline arguments? argv, *ARGV* and ext:*ARGV*
>> don't work. I get the error "Unbound variable" (when I type "scheme
>> --load myprog.scm").
> The procedure for retrieving command-line arguments with --load is
> called `command-line-arguments'.
>
> https://www.gnu.org/software/mit-scheme/documentation/mit-scheme-user/Command_002dLine-Options.html

Thank you very much, but I unsuccessfully tried the following:

-------------------------

(define inputfile 0)

(set! inputfile (open-input-file (car (command-line-arguments))))

------------------------

What is the correct usage of command-line-arguments?

Thanks in advance

Peter


_______________________________________________
MIT-Scheme-devel mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/mit-scheme-devel
_______________________________________________
MIT-Scheme-devel mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/mit-scheme-devel

reply via email to

[Prev in Thread] Current Thread [Next in Thread]