Processing
 

How do you run a scheme program in the terminal of Ubuntu?

24/09/2014 04:45#1

War Gravy

Member

Joined at: 6 months ago

Post: 1

Thank: 0

Thanked: 0

I have searched and I really can't seem to find this really basic question. I am new to mit-scheme and essentially I want to recreate hello world but instead of doing it through the prompt, I want to have a scheme file that contains the following code:

 (define hello-world  (lambda ()      (begin         (write 'Hello-World)         (newline)         (hello-world)))) 

The problem is I am missing the simplest questions: What is the file extension for a scheme file? How do I run that file through scheme?

I have tried .ss and .scm but every time I try scheme hello-world.scm it says:

;Warning: Invalid keyword: "hello-world.scm"  ;Warning: Unhandled command line options: ("hello-world.scm") 
24/09/2014 04:49Top#2

Joined at: 10 months ago

Post: 2

Thank: 0

Thanked: 0

Your issue isn't the file extension, it's just that MIT Scheme prints an error if invoked as scheme hello-world.scm, since it's supposed to be invoked as

scheme --load hello-world.scm 

Also, note that you are using a left-quote character rather than the actual quote character '. If you look closely you can see the difference.

04/07/2016 07:22Top#3

ven0m

Member

Joined at: 6 months ago

Post: 1

Thank: 0

Thanked: 0

Start the scheme interpreter in the same directory as your file. Once you are in the interpreter of mit-scheme, you can always use the following procedure which is built into scheme:

(load "file-name.extension") 

This will load the file into scheme. I hope that helped :)

Similar articles

Non-interactive method for dpkg-reconfigure tzdata

5 years ago - Reply: 3 - Views: 140

monit is not able to read mongod.lock

2 years ago - Reply: 3 - Views: 138

Ubuntu: hadoop command not found

2 years ago - Reply: 4 - Views: 244

C# Mono Console.ReadLine quitting

4 years ago - Reply: 1 - Views: 87

linking jsoncpp on Ubuntu

2 years ago - Reply: 1 - Views: 5

Build artifacts over ssh jenkins - PHP

2 years ago - Reply: 1 - Views: 37

Can't load Metasploit after installation

2 years ago - Reply: 5 - Views: 212

Selenium FirefoxDriver in Headless get error

2 years ago - Reply: 1 - Views: 96

Unable to start MongoDB. ERROR: addr already in use

2 years ago - Reply: 2 - Views: 118

ZSH Agnoster Theme showing machine name

2 years ago - Reply: 4 - Views: 248

Unable to start firefox browser with jenkins user

2 years ago - Reply: 2 - Views: 110

vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re