For Programmers: Free Programming Magazines  


Home > Archive > Scheme > May 2004 > Just starting with SISC Scheme, need some help









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 Just starting with SISC Scheme, need some help
Mark Conrad

2004-05-15, 2:31 pm


Hi all, I am resuming Scheme after many years of absence, so am
basically starting from scratch, right at the beginning.

I settled on SISC Scheme because it is supposedly "fully compliant"
with the R5RS standard, and am basically happy with it.

My main textbook will be "Scheme and the Art of Programming".

....supplemented by SICP, The Little Lisper, and much later on
"Essentials of Programming Languages".

My question is:
Is there a library of Scheme source code available somewhere that
will work with SISC Scheme, something that can extend that version of
Scheme such that it is easier for a newbie to use for learning
purposes?

What I really miss are things like "transcript-on", "transcript-off"
etc. so I could save my practice sessions.

I want to get a good running start at learning Scheme, and lack of the
more rudimentary procedures built into some other Scheme's is really
slowing down my learning efforts.

Later on of course, after I learn much more Scheme, I will be able to
create these procedures myself, but that does me no good right now when
I know so little Scheme.

Sorry for asking such an obviously newbie question here.

Mark-
Scott G. Miller

2004-05-15, 6:32 pm

Mark Conrad wrote:
> Hi all, I am resuming Scheme after many years of absence, so am
> basically starting from scratch, right at the beginning.
>
> I settled on SISC Scheme because it is supposedly "fully compliant"
> with the R5RS standard, and am basically happy with it.
>
> My main textbook will be "Scheme and the Art of Programming".
>
> ...supplemented by SICP, The Little Lisper, and much later on
> "Essentials of Programming Languages".
>
> My question is:
> Is there a library of Scheme source code available somewhere that
> will work with SISC Scheme, something that can extend that version of
> Scheme such that it is easier for a newbie to use for learning
> purposes?
>
> What I really miss are things like "transcript-on", "transcript-off"
> etc. so I could save my practice sessions.
>


I suggest running SISC from within Emacs using the quack.el addon (see
http://www.neilvandyke.org/quack/). This will let you save your
progress at will, as well as edit code in one buffer and evaluate it in
the interpreter buffer. Quack also links (in Emacs) to the SISC users
manual, as well as the various Scheme SRFIs.

I'm aware that you're running on Mac OS X, and are a newbie to the Unix
environment. You may find this link helpful for using Emacs on your
computer:

http://members.shaw.ca/akochoi-emacs/

You may also want to define the following, which is used in SICP often:

(define first car)
(define second cadr)
(define third caddr)


Scott
Terrence Brannon, Scheme Hacker

2004-05-16, 6:31 am

Scott G. Miller wrote:

>
> You may also want to define the following, which is used in SICP often:
>
> (define first car)
> (define second cadr)
> (define third caddr)
>


or just load in SRFI-1 which has selectors from 1 to 10 standard
Mark Conrad

2004-05-16, 9:31 am

In article <40A68C1B.2070506@freenetproject.org>, Scott G. Miller
<scgmille@freenetproject.org> wrote:

> I suggest running SISC from within Emacs using the quack.el addon (see
> http://www.neilvandyke.org/quack/). This will let you save your
> progress at will, as well as edit code in one buffer and evaluate it in
> the interpreter buffer. Quack also links (in Emacs) to the SISC users
> manual, as well as the various Scheme SRFIs.



Thanks, that will take care of saving my practice sessions, and give me
some experience using Emacs as well.

I would still like to acquire a library of commonly used Scheme
functions, but guess I will have to create them from scratch.

....and load them in automatically from the Scheme startup file, as soon
as I learn how to do that in the sisc version of Scheme.

No big deal. (I hope) <g>

Mark-
Scott G. Miller

2004-05-16, 10:32 am

Mark Conrad wrote:
> In article <40A68C1B.2070506@freenetproject.org>, Scott G. Miller
> <scgmille@freenetproject.org> wrote:
>
>
>
>
>
> Thanks, that will take care of saving my practice sessions, and give me
> some experience using Emacs as well.
>
> I would still like to acquire a library of commonly used Scheme
> functions, but guess I will have to create them from scratch.
>
> ...and load them in automatically from the Scheme startup file, as soon
> as I learn how to do that in the sisc version of Scheme.


Just edit the "sisc" file, and add the file(s) you wish to load to the
end of the command line which starts SISC at the very end of the script.

Scott
Terrence Brannon, Scheme Hacker

2004-05-16, 1:32 pm

Mark Conrad wrote:

>
> I would still like to acquire a library of commonly used Scheme
> functions, but guess I will have to create them from scratch.
>


have you seen:

http://srfi.schemers.org

?

Also, you might check out sunterlib.. oops! different scheme distro! nevermind.
Mark Conrad

2004-05-16, 4:32 pm

In article <S3Npc.78243$sK3.22157@nwrddc03.gnilink.net>, Terrence
Brannon, Scheme Hacker <metaperl@urth.org> wrote:

> Mark Conrad wrote:
>
>
> have you seen:
>
> http://srfi.schemers.org
>
> ?



Yes, but that website kinda overwhelmed me because of all the acronyms
they used there, which I don't understand yet.

Perhaps I better explain more precisely what I am after in a "library"
for SISC Scheme.

Namely, I would like to find a downloadable file of Scheme source code
that would be compatable with the SISC version of Scheme, as ran on
Apple hardware if that makes any difference. (probably not)

Right now I run the Mac OS 10.3.3 (so-called "Panther") on an Apple
"Pismo" model powerbook with 1-GB of RAM.

"Panther" is Apple's acronym for their newest Unix based operating
system, to which Apple has added their own proprietory graphics user
interface.

Panther has a more-or-less standard Unix command-line-interface, (using
the BASH shell) - plus Apple's own graphical-users-interface. (icons,
click and drag, etc.)

I presently start up SISC Scheme from the Unix command line, by typing:

cd /usr/local/sisc/

- - - then - - -

../sisc <=== note the "dot" just before the forward-slash



What I would like to acquire are extensions to SISC Scheme that support
such things as "blinking" parenthesis, automatic indenting of
source-code, transcipt-on/transcript-off, and the more common things
like the atom? predicate used in the "Little Lisper" book, plus
possibly the lower-level procedures used in the latest edition of the
SICP Scheme book.

All this while maintaining full compatability with the Scheme standard.

Oh yes, and as long as I am asking for the moon, perhaps some
procedures that help in using the latest defacto "hygenic" Scheme
macros, as reflected by today's usage of those macros by Scheme folks.

My ultimate aim is to get a "quick" grounding in Scheme. (by "quick" I
mean say a year or so of intensive self instruction)

....such that I will have little trouble understanding that advanced
Scheme book "Essentials of Programming Languages".

I wrestled that book years ago, just barely managing to do stuff like
manual conversion of procedures to "Continuation Passing Style".

Never did manage to fully understand exactly how "Wind" and "Unwind"
work. Supposedly, languages like Common Lisp have 'downward' excape
procedures implemented by catch and throw, but they can't excape
'upwards' like Wind/Unwind allow.

I never did understand "upwards" versus "downwards", whether they
were refering to the stack or what.

Anyhow, all that is in the distant past, I have essentially forgotten
all my Scheme, so am starting from scratch again.

Don't wanna get too sidetracked with learning Emacs, Unix, etc. because
I think I will have enough trouble just learning Scheme.

It does not help that I am in my 'Golden Years' and my memory is shot.

Hope this explains a little of what I am after in a "library" of Scheme
procedures to help me learn Scheme.

Again, sorry for unburdening my petty problems in this Scheme NG, I
know you guys have better things to do than dealing with stuff I should
be handling myself.

Mark-
Mark Conrad

2004-05-16, 4:32 pm

In article <95-dna9GGNzr7jrdRVn-ig@giganews.com>, Scott G. Miller
<scgmille@freenetproject.org> wrote:

>
> Just edit the "sisc" file, and add the file(s) you wish to load to the
> end of the command line which starts SISC at the very end of the script.


Thanks very much for that info'

Mark-
Neil W. Van Dyke

2004-05-16, 5:31 pm


What I think comes closest to what you describe is PLT DrScheme.

If you really want to stick to "standard Scheme" with DrScheme...
when you start up DrScheme, and it says "Welcome to DrScheme, Please
select a language," click on the first item, which is "Standard (R5RS)."

(I usually use the "PLT -> Textual (MzScheme, includes R5RS)" language,
which is the second item on the list. You can switch to that whenever
you feel comfortable.)

http://download.plt-scheme.org/drscheme/

Note that I wouldn't discourage use of SISC, and in fact at least a
couple of the developers I know who are predominantly PLT Scheme users
also use SISC because it lets them deploy in Java JVM environments.
However, you really sound like you're asking for DrScheme right now.


Mark Conrad <NoSpamDammit@invalid.com> writes:
[...]
> What I would like to acquire are extensions to SISC Scheme that support
> such things as "blinking" parenthesis, automatic indenting of
> source-code, transcipt-on/transcript-off, and the more common things
> like the atom? predicate used in the "Little Lisper" book, plus
> possibly the lower-level procedures used in the latest edition of the
> SICP Scheme book.
>
> All this while maintaining full compatability with the Scheme standard.
>
> Oh yes, and as long as I am asking for the moon, perhaps some
> procedures that help in using the latest defacto "hygenic" Scheme
> macros, as reflected by today's usage of those macros by Scheme folks.

[...]
> Don't wanna get too sidetracked with learning Emacs, Unix, etc. because
> I think I will have enough trouble just learning Scheme.

[...]
Scott G. Miller

2004-05-16, 5:31 pm

Mark Conrad wrote:

> In article <S3Npc.78243$sK3.22157@nwrddc03.gnilink.net>, Terrence
> Brannon, Scheme Hacker <metaperl@urth.org> wrote:
>
>
>
>
>
> Yes, but that website kinda overwhelmed me because of all the acronyms
> they used there, which I don't understand yet.
>
> Perhaps I better explain more precisely what I am after in a "library"
> for SISC Scheme.
>
> Namely, I would like to find a downloadable file of Scheme source code
> that would be compatable with the SISC version of Scheme, as ran on
> Apple hardware if that makes any difference. (probably not)
>

Nope.

> What I would like to acquire are extensions to SISC Scheme that support
> such things as "blinking" parenthesis, automatic indenting of
> source-code, transcipt-on/transcript-off, and the more common things


Emacs can get you all of the above.

> like the atom? predicate used in the "Little Lisper" book, plus
> possibly the lower-level procedures used in the latest edition of the
> SICP Scheme book.


atom? was discussed previously in this newsgroup.

>
> All this while maintaining full compatability with the Scheme standard.
>
> Oh yes, and as long as I am asking for the moon, perhaps some
> procedures that help in using the latest defacto "hygenic" Scheme
> macros, as reflected by today's usage of those macros by Scheme folks.
>

You'll want to be more specific with the above. As far as I know most
people don't need any procedures to use hygienic macros.

> My ultimate aim is to get a "quick" grounding in Scheme. (by "quick" I
> mean say a year or so of intensive self instruction)
>

I suggest you focus less on gathering software, and just start working
through a tutorial such as Teach Yourself Scheme in Fixnum Days.
You have all you need already.

> I never did understand "upwards" versus "downwards", whether they
> were refering to the stack or what.


Try reading this conversational walk through continuations:

http://www.bloodandcoffee.net/campb...on-tutorial.log

> Don't wanna get too sidetracked with learning Emacs, Unix, etc. because
> I think I will have enough trouble just learning Scheme.


Okay, in that case, you don't need any of the above. Just use SISC or
PLT and get started. Don't get hung up on standards compliance, the
tutorials you work through will stick close to it anyway. Ask real
questions about the problems you run into as you learn.

Scott
Mark Conrad

2004-05-17, 2:34 pm

In article <96oeooxhq9.fsf@neilvandyke.org>, Neil W. Van Dyke
<neil@neilvandyke.org> wrote:

> Note that I wouldn't discourage use of SISC, and in fact at least a
> couple of the developers I know who are predominantly PLT Scheme users
> also use SISC because it lets them deploy in Java JVM environments.
> However, you really sound like you're asking for DrScheme right now.


I think you are right, literally everyone so far is recommending that I
do not unduly focus on 100-percent R5RS compliant Scheme, because I
will then have to sacrifice too many other good features that could
slow down my progress in learning Scheme.

Dang, I hate to have to choose between varieties of Scheme, they are
all good.

Besides, everyone recommends a different variety ;-)

Okay, time for some point-blank questions.

Why do you favor the "PLT Textual MzScheme" flavor of DrScheme.

I am not trying to start any wars, but would welcome any other people
telling me why they favor their particular version of Scheme, because
it certainly will help me make up my mind on what to stick with, more
or less.

Keep in mind I probably will screw up loading _any_ version of
Scheme, because right now I am totally ignorant about the Unix command
line.

Thanks everyone, for all this fine help.

Mark-
Mark Conrad

2004-05-17, 2:34 pm

In article <r6mdnUEuiMpnVDrd4p2dnA@giganews.com>, Scott G. Miller
<scgmille@freenetproject.org> wrote:

>
> Okay, in that case, you don't need any of the above. Just use SISC or
> PLT and get started. Don't get hung up on standards compliance, the
> tutorials you work through will stick close to it anyway. Ask real
> questions about the problems you run into as you learn.


Okay, that sounds like good advice. I already have DrScheme, but have
not compared it on a case by case basis with SISC yet.



> Ask real questions about the problems you run into as you learn.


Hokay, I wanna beat around the bush on that whole Wind/Unwind thing in
Scheme, before I _really_ tackle it in earnest, just to get a feel
for it.

Lemme rant a little about it, because presently it is a burr in my
dle. They start refering to Wind/Unwind about page 321 in
"Essentials of Programming Languages".

Excuse everything that follows, it is all probably dead wrong, but it
is my present understanding of Wind/Unwind.

I assume that Wind/Unwind refer to the FIFO call stack of Scheme, which
keeps track of the tower of procedure calls of deeply nested functions.

That stack 'winds up' when many nested procedures are "called" (entered)

The most recently called procedure is on the 'top' of that stack, and
the toplevel oldest procedure on the 'bottom'.

When the newest (top) procedure decides to "escape" to toplevel, either
via Catch/Throw or via a continuation, the call stack instantly
"unwinds", meaning all the intermediate procedures get ignored and
control reverts to the toplevel procedure. (which is on the bottom of
the call stack)

A _different_ stack of "environments" cleans up stray stuff like
closing open files etc. so bugs do not occur when control reverts to
toplevel.

Now what really frosts my pumpkin is that the book sez that languages
like CL can only normally support "downward" escape procedures, which
is kinda counter-intuitive in my view when talking about deeply nested
procedures escaping 'back up to toplevel' - - - unless of course they
are talking about the call-stack, where escaping 'downwards' (to the
toplevel procedure on the bottom of the call-stack) - makes more sense.

End of my confusing rant. Just ignore all this and chalk it up to a
frustrated newbie who should be more concerned with basic essentials of
the language.

Mark-
Neil W. Van Dyke

2004-05-17, 3:33 pm

Mark Conrad <NoSpamDammit@invalid.com> writes:
> Why do you favor the "PLT Textual MzScheme" flavor of DrScheme.


As opposed to the "Standard (R5RS)" language that DrScheme also
supports? The "PLT Textual MzScheme" language lets me use R5RS *plus*
nonstandard stuff when I need it.

But if, as you said originally, you want to use *only* R5RS, DrScheme is
happy to enforce that. (In this mode, she is MistressScheme, the stern
dominatrix, and the ladybug is her symbol.)

> I am not trying to start any wars, but would welcome any other people
> telling me why they favor their particular version of Scheme, because
> it certainly will help me make up my mind on what to stick with, more
> or less.


The main reason I recommended PLT DrScheme is that you said you didn't
want to use Emacs. If you were willing to use Emacs, you almost
couldn't go wrong with whichever Scheme implementation you picked.
Mark Conrad

2004-05-18, 6:31 am

In article <65n046hq5t.fsf@neilvandyke.org>, Neil W. Van Dyke
<neil@neilvandyke.org> wrote:

>
> As opposed to the "Standard (R5RS)" language that DrScheme also
> supports? The "PLT Textual MzScheme" language lets me use R5RS *plus*
> nonstandard stuff when I need it.
>
> But if, as you said originally, you want to use *only* R5RS, DrScheme is
> happy to enforce that. (In this mode, she is MistressScheme, the stern
> dominatrix, and the ladybug is her symbol.)


That all sounds reasonable.



> The main reason I recommended PLT DrScheme is that you said you didn't
> want to use Emacs. If you were willing to use Emacs, you almost
> couldn't go wrong with whichever Scheme implementation you picked.


Yes, that is only temporary though, because I have all sorts of plans
for Emacs, once I get Scheme under my belt.

I am waiting for the final alpha release of "Emacs Common Lisp" to come
out, which I am told is a kind of byte code compiler that can extend
the resident Emacs in OSX so that it can handle lexical closures and
other stuff that Emacs can't presently handle because of the old
version of Lisp incorporated in Emacs.

A beta version of "Emacs Common Lisp" is supposedly available right
now, but I am told it is fairly buggy.

Thanks again everyone for all the help.

Now to get back to studying my main Scheme textbook, "Scheme and the
Art of Programming".

After I digest that book, I am really looking forward to tackling:

"Essentials of Programming Languages"

To really digest both those books thoroughly, I estimate a years time.

Mark-
Joe Marshall

2004-05-19, 1:31 am

Mark Conrad <NoSpamDammit@invalid.com> writes:

> I assume that Wind/Unwind refer to the FIFO call stack of Scheme, which
> keeps track of the tower of procedure calls of deeply nested functions.
>
> That stack 'winds up' when many nested procedures are "called" (entered)


Well, the original terminology came from long ago where when you
aborted a computation you had to `unwind' the stack rather than simply
blow it away. Presumably the stack would have had to have been
`wound-up' in the first place but no one ever seems to use that
expression that way.

Scheme allows you to transfer control back *in* to a computation.
When you do this, you have to undo the unwinding and this has been
called `winding'. In general, winding/unwinding usually refer to
updating the dynamic state on non-local transfer of control.
Technically, I suppose, calling a function would count as `winding'
but this sort of normal control transfer isn't usually what is meant.

> The most recently called procedure is on the 'top' of that stack, and
> the toplevel oldest procedure on the 'bottom'.


Yes. Like a stack of dishes: you can't get at older bottomost stuff
until you get the newest topmost stuff out of the way.

> When the newest (top) procedure decides to "escape" to toplevel, either
> via Catch/Throw or via a continuation, the call stack instantly
> "unwinds", meaning all the intermediate procedures get ignored and
> control reverts to the toplevel procedure. (which is on the bottom of
> the call stack)


The stack isn't *instantly* unwound...

> A _different_ stack of "environments" cleans up stray stuff like
> closing open files etc. so bugs do not occur when control reverts to
> toplevel.


.... because this `dynamic state' has to be dealt with. The cleanup
forms have to be run within the lexical and dynamic state where they
were established, so what *really* goes on is that the stack is
partially unwound, control transfers to a cleanup function, when the
cleanup function is done, more of the stack is unwound until the next
cleanup function and so forth until we get to the desired contol
point. In Scheme, since you can transfer control back in after you
have `unwound' you need to `rewind' the unwinding. The distinction
between `unwinding' and `rewinding' really has no meaning so it is
usually just called `winding' no matter what direction you go in. The
important point is that you do not transfer control instantaneously
but by incremental transfers through intermediate states.



> Now what really frosts my pumpkin is that the book sez that languages
> like CL can only normally support "downward" escape procedures, which
> is kinda counter-intuitive in my view when talking about deeply nested
> procedures escaping 'back up to toplevel' - - - unless of course they
> are talking about the call-stack, where escaping 'downwards' (to the
> toplevel procedure on the bottom of the call-stack) - makes more sense.


The `downward' in this case is referring to the function calling. The
function that called the current one is `above' it and the functions
that the current one calls are `below' it (and thus the
read-eval-print loop is at `top-level'). Unfortunately, this is
exactly the opposite direction of how stacks are usually talked
about. So when you execute a `catch' in Common Lisp, you can only
pass it `downward'. When you throw, you throw `up' to some caller
`above'. Once again we invert the usage and talk about
`downward-only' escaping --- the `escaping' is done in the `upwards'
direction, you can only do it from somewhere `below'.

In Scheme, however, it can be even more confusing because you can
`throw down' (or `throw back in').

> End of my confusing rant. Just ignore all this and chalk it up to a
> frustrated newbie who should be more concerned with basic essentials of
> the language.


This sort of thing is quite confusing and mostly unimportant (except
in some situations where it becomes *very* important, like handling
errors, and modelling non-deterministic programming and web
applications.)


--
~jrm
Jens Axel Søgaard

2004-05-19, 3:32 pm

Mark Conrad wrote:


> In BNF, this is used ::=
>
> ( _two_ colons followed by the = symbol)
>
> It is explained in various tutorials about Backus-Naur Form, no problem.
>
> However, in the book "Essentials of Programming Languages" some other
> variety of form is used, namely :=
>
> ( a _single_ colon immediately followed by = as in := )
>
> That is used throughout the book, with no explanation of what it means,
> as in this BNF example on page 313
>
> --> define resume = proc (x) error();
> --> define break =
> proc (x)
> letcont cont
> in begin
> resume := cont;
> write(breakmsg);
> toplevel (x)
> end;


Normally := is an assignment.

The equivalent to

x := 42;

is in Scheme

(set! x 42)

--
Jens Axel Søgaard
Sponsored Links







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

Copyright 2008 codecomments.com