For Programmers: Free Programming Magazines  


Home > Archive > Scheme > January 2008 > Help on using MzScheme with OS X









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Help on using MzScheme with OS X
Alfonso G. Urroz

2008-01-14, 4:31 am

Hello there, I am trying to use the book by Dorai Sitaram, titled "Learn
Scheme in a Fixed Number of Days", all the examples in the book are done
using MzScheme.

I am using a mac Powerbook, running OS X version 10.4.11, I have installed
MzScheme inside a directory within the Desktop. What I am trying to do is
use and run MzScheme like you will use Perl or Python on a Mac using the
the terminal window.

For some reason (it must be obvious for a Mac expert), I can't run
MzScheme from the terminal, i have to go inside the directory where it is
installed and click on the "MzScheme" icon, and then it works fine.

Now, if I try to run a very simple file that displays the string Hello
World on the screen, it doesn't work either, when I issue the command
(from MzScheme REPL) (load "hello.scm") an error message comes up.

Please, just tell me what files do I have to edit, in order to make this
thing work, I know it must be something very simple, but I just don't know
what to do.

Thanks.

Alfonso G. Urroz

Eric Hanchrow

2008-01-14, 4:31 am

>>>>> "Alfonso" == Alfonso G Urroz <urrozalf@vcn.bc.ca> writes:

Alfonso> For some reason (it must be obvious for a Mac expert), I
Alfonso> can't run MzScheme from the terminal,

What happens when you try? On my box, I have to type

$ /Applications/PLT\ Scheme\ v371/bin/mzscheme

i.e., it's not on my PATH.

Alfonso> when I issue the command (from MzScheme REPL) (load
Alfonso> "hello.scm") an error message comes up.

Can't help you there, without knowing the contents of the file
"hello.scm", and the text of the error message.

--
Fat is beautiful. Fat is our friend.
-- Armandino Batali, owner of Salumi
josephhallett@gmail.com

2008-01-14, 4:31 am

Hmmm... I'm trying to do a similar thing.
I seem to remember having a similar problem with mzscheme, I installed
it with Darwin Ports (into /opt/local/bin/mzscheme) and that works
fine now...

That said Guile also works fine with the teach-yourself-scheme book,
except for one command which the code for guile is provided in the
book.

Either way try going through Darwin Ports.
Andrew Reilly

2008-01-14, 8:15 am

On Mon, 14 Jan 2008 00:13:46 -0800, josephhallett@gmail.com wrote:

> Hmmm... I'm trying to do a similar thing. I seem to remember having a
> similar problem with mzscheme, I installed it with Darwin Ports (into
> /opt/local/bin/mzscheme) and that works fine now...


That's because Darwin Ports/MacPorts installs executables into a common
bin directory, which is in your $PATH, Unix style. On the other hand,
the PLT MzScheme installer (or the DrScheme installer, perahps) will just
give you a directory full of .app directories, Mac style. If you look
into them from the console, you will see that the DrScheme.app directory
contains a bin directory, which contains mzscheme, which you can execute
from the command line either by:
1) using the full path, as Eric suggested, up-thread
2) putting the path into your .profile (this is what I do: you just have
to be careful about the space in the directory name.)
3) put a short shell script into /usr/local/bin (or somewhere else that
*is* in your path already) that exec's mzscheme from the correct path,
with all of the original arguments intact. Something like:
#!/bin/sh
exec "/Applications/PLT Scheme 372/bin/mzscheme" "$@"
should do the job.

The OP probably wants to find a good book on Unix and the standard Unix
command set and environment, too. There are some OK tutorials on-line.

Cheers,

--
Andrew
Raffael Cavallaro

2008-01-14, 7:22 pm

On 2008-01-14 01:11:09 -0500, "Alfonso G. Urroz" <urrozalf@vcn.bc.ca> said:
>
> For some reason (it must be obvious for a Mac expert), I can't run
> MzScheme from the terminal, i have to go inside the directory where it is
> installed and click on the "MzScheme" icon, and then it works fine.
>
> Now, if I try to run a very simple file that displays the string Hello
> World on the screen, it doesn't work either, when I issue the command
> (from MzScheme REPL) (load "hello.scm") an error message comes up.
>
> Please, just tell me what files do I have to edit, in order to make this
> thing work, I know it must be something very simple, but I just don't know
> what to do.


In your home directory there is/should be an invisible file named
..bash_profile (if your shell is bash). Add the line:

export PATH=$PATH:/Applications/PLT\ Scheme\ v372/bin

(assuming you're using the latest 372 version, adjust otherwise)

Then the PLT Scheme bin directory will be in your path and simply typing:

mzscheme


in Terminal.app will launch it

Danny Yoo

2008-01-24, 7:31 pm

On Jan 14, 1:11 am, "Alfonso G. Urroz" <urroz...@vcn.bc.ca> wrote:
> Hello there, I am trying to use the book by Dorai Sitaram, titled "Learn
> Scheme in a Fixed Number of Days", all the examples in the book are done
> using MzScheme.


Out of curiosity, since you're using Mac OS X, why not use the
DrScheme IDE? It provides a nice graphical user interface, and you
should be able to do the same sort of things you can do with mzscheme
on your terminal. But as an added benefit, error tracebacks show up
visually in DrScheme, highlighting and all.

There's a guide to using DrScheme here:

http://www.plt-scheme.org/software/...tour-Z-H-3.html

The only tricky thing you might run into, when you first start with
DrScheme, is to choose an appropriate language level. To support the
primitives that "Learn Scheme in Fixnum Days" depends on, you'll
probably want to use the "Pretty Big" language level.

Good luck!
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com