-> non-X
-> mzscheme == shows blurb
-> ( + 2 3 ) == 5
-> experiment & find how to: ( exit) == OK
-> now write file: Sample1.ss == (+ 2 3 )
-> try: mzschem -f Sample1.ss == much IDE activity & exits
without output.
Please advise how do I start collecting and running my
sample tutorials/test in file/s.
==TIA.
No matter how brilliant your software, nor how many life-times
of labour it cost you. Respect the users' time. They don't want to
get married to your ideas until such ideas are proven better than
their existing knowledge. M$ made their fortune by respecting
the users' prior investment in DOS.
Also don't assume that users are on an allways connected
inet connection.
> It's called 'successive refinement'.
>
> -> non-X
> -> mzscheme == shows blurb
> -> ( + 2 3 ) == 5
> -> experiment & find how to: ( exit) == OK
> -> now write file: Sample1.ss == (+ 2 3 )
> -> try: mzschem -f Sample1.ss == much IDE activity & exits
> without output.
Why should it produce any output?
--
__Pascal Bourguignon__
Is anybody prepared to tell how I should write and load/run
my source file/s, so that I may accumulate my keyed-in tests.
== TIA.
You shouldn't be surprised by no output ... you didn't start mzscheme
interactively and your code doesn't print anything.
try: (print (+ 2 3))
George
Why should we answer to a question you didn't ask?
--
__Pascal Bourguignon__
> On Mon, 22 Feb 2010 02:57:15 +0000 (UTC), no.to...@gmail.com wrote:
>
> >In article <878wan9...@galatea.lan.informatimago.com>, p...@informatimago.com (Pascal J. Bourguignon) wrote:
> >
> > Is anybody prepared to tell how I should write and load/run
> > my source file/s, so that I may accumulate my keyed-in tests.
>
> You shouldn't be surprised by no output ... you didn't start mzscheme
> interactively and your code doesn't print anything.
>
> try: (print (+ 2 3))
>
> George
OK thanks, so '-f' is to run an unattended executable?
Why can't you write how I'd: "write and load/run
my source file/s, so that I may accumulate my keyed-in tests."
??
Will mzscheme make me childishly sarcastic too ?
You haven't given enough detail of what you are trying to do ... it
makes a big difference whether you are interactively entering data at
the console, needing to read files of data at runtime or are loading
files of static data into your program prior to execution (or worse,
loading static data during execution).
Just requiring the console for interactive use will not prevent you
from sending results to a file - you can redirect error output in your
shell command and print your results to (current-error-port), or you
can send output to user specified files with (with-output-to-file).
As for structuring programs, generally you arrange that the last form
in the (last loaded) file starts execution - for example:
(define (do-thing ...) ... )
(define (do-other ...) ... )
(begin
(do-thing ...)
(do-other ...))
or possibly
(define (go)
(do-thing ...)
(do-other ...))
(go)
>Will mzscheme make me childishly sarcastic too ?
Probably. If not, asking questions here will do it.
George
> Will mzscheme make me childishly sarcastic too ?
You'll find that Usenet posters, in general, tend to have a fairly low
tolerance for questions that are trivially answered by the relevant
documentation. I imagine that that is particularly the case for
mzscheme, because the supplied documentation is good.
Hint: try "mzscheme --help", and then read enough of the documentation to
know what the various alternatives mean. There are *several* ways to run
your source files: which to choose depends on what you want to achieve.
Cheers,
--
Andrew
We're trying to make you think by yourself.
In person we may have adopted the zen technique if hitting you on the
head ;-)
In any case, if you tried to answer honestly to the questions asked
back, you would to understand your problem and find the solution by
yourself.
(Notice that my second question was identical to my first question).
--
__Pascal Bourguignon__
> >
> >OK thanks, so '-f' is to run an unattended executable?
> >Why can't you write how I'd: "write and load/run
> >my source file/s, so that I may accumulate my keyed-in tests."
>
> You haven't given enough detail of what you are trying to do ...
For all interpretive languages, the first simples test is interactive:
( + 2 3 )
( print 'TheCatSat )
( define dog 5 )
( define cat 3 )
( = cat dog)
(exit)
----- for lesson 2 you want to save your key-ins in a file
and continue interactively ---------
So that eg. 'it knows that dog = 5' and you don't have to
RE-key-in lesson one.
So apparently you want to load and interpret your
sample/S files, [like I guess it auto loads much of its own
customisation] and continue interactively .
HOW can I do that ?
== TIA.
You edit a file with:
---------[definitions.ss]---------------
(define dog 5)
(define cat 3)
----------------------------------------
(There's no point in leaving forms that have no side effect).
then interactively you use load:
> (load "definitions.ss)
> dog
5
> (+ cat dog)
8
> (exit)
--
__Pascal Bourguignon__
]You edit a file with:
]---------[definitions.ss]---------------
](define dog 5)
](define cat 3)
]----------------------------------------
They are not so much definitions as a log-capture of previous
key-ins.
] (There's no point in leaving forms that have no side effect).
The important 'side effect' is seeing immediately the
(+ 3 5) = 8; which confirms that it's running.
]then interactively you use load:
] > (load "definitions.ss)
It doesn't come back with ">"
It just echoes the key-in and needs
Ctl/Z to exit.
] > dog
] 5
] > (+ cat dog)
] 8
] > (exit)
I don't like that method.
I want to immediately see a confirmation that the
'previousStuff.ss' has loaded and run.
*.ss will have to be on a 'good' path.
I'm expecting/hoping-for something like:
mzscheme -f X.ss
to run mzscheme and load and run X.ss and
then go to interactive mode.
Which IIRC xlisp did decades ago under DOS
on a 286, without waiting for it to first calculate
the US army pay-roll.
What is mzscheme doing ?!
Is it too memory intensive for my spare PC?
--
__Pascal Bourguignon__
== TIA
> In article <87sk8ry...@galatea.lan.informatimago.com>, p...@informatimago.com (Pascal J. Bourguignon) wrote:
>> no.to...@gmail.com writes:
>>
>> > In article <bse6o5hrugdb4sdtd...@4ax.com>, nobody wrote:
>> >
> - - -
>> HOW can I do that ?
>
> ]You edit a file with:
>
> ]---------[definitions.ss]---------------
> ](define dog 5)
> ](define cat 3)
> ]----------------------------------------
> They are not so much definitions as a log-capture of previous
> key-ins.
>
> ] (There's no point in leaving forms that have no side effect).
> The important 'side effect' is seeing immediately the
> (+ 3 5) = 8; which confirms that it's running.
>
> ]then interactively you use load:
>
> ] > (load "definitions.ss)
> It doesn't come back with ">"
> It just echoes the key-in and needs
> Ctl/Z to exit.
Of course, since I didn't close the string (which shows that I didn't
copy-and-paste a real session), and you didn't notice it and correct it.
You cannot copy-and-paste blindly stuff you get from the Internet! You
have to understand it and correct it, at least when there are trivial
errors.
> ] > dog
> ] 5
> ] > (+ cat dog)
> ] 8
> ] > (exit)
>
> I don't like that method.
> I want to immediately see a confirmation that the
> 'previousStuff.ss' has loaded and run.
The renewed prompt is confirmation that everything went well.
If there was an error with or in the file, you would be informed of it!
But in any case, scheme will never do anything before you enter a
complete form.
One way to avoid this kind of silly typoes, is to use emacs.
Put and evaluate:
(setq inferior-lisp "/path/to/your/mzscheme")
(defalias 'scheme 'inferior-lisp)
in ~/.emacs
Then use M-x scheme RET to launch mzscheme.
In the *inferior-lisp* buffer, standard emacs features are available,
such as paren matching and string colorization...
> *.ss will have to be on a 'good' path.
> I'm expecting/hoping-for something like:
> mzscheme -f X.ss
> to run mzscheme and load and run X.ss and
> then go to interactive mode.
> Which IIRC xlisp did decades ago under DOS
> on a 286, without waiting for it to first calculate
> the US army pay-roll.
Why don't you read the documentation of mzscheme? Try:
mzscheme --help
> What is mzscheme doing ?!
I don't know. Try it!
> Is it too memory intensive for my spare PC?
Who would know, beside you?
--
__Pascal Bourguignon__
> > ]then interactively you use load:
> >
> > ] > (load "definitions.ss)
> > It doesn't come back with ">"
> > It just echoes the key-in and needs
> > Ctl/Z to exit.
>
> Of course, since I didn't close the string (which shows that I didn't
> copy-and-paste a real session), and you didn't notice it and correct it.
>
As a linux user that was my first suspicion.
But it's such a lumbering monster, and you can't even edit the input line
except by backspace. That's the main reason that I want to capture
my prior key-ins.
> You cannot copy-and-paste blindly stuff you get from the Internet! You
> have to understand it and correct it, at least when there are trivial
> errors.
>
>
> One way to avoid this kind of silly typoes, is to use emacs.
> Put and evaluate:
> (setq inferior-lisp "/path/to/your/mzscheme")
> (defalias 'scheme 'inferior-lisp)
> in ~/.emacs
>
> Then use M-x scheme RET to launch mzscheme.
>
> In the *inferior-lisp* buffer, standard emacs features are available,
> such as paren matching and string colorization...
>
That's another layer on top of already bloat ?
>
> Why don't you read the documentation of mzscheme? Try:
>
> mzscheme --help
>
No, it's crap. Life is too short.
I'm not using X, and I don't want to be a concert pianist.
I want ONE key to start it running my previously saved work.
== Thanks.
> In article <87k4u3y...@galatea.lan.informatimago.com>, p...@informatimago.com (Pascal J. Bourguignon) wrote:
>
>> > ]then interactively you use load:
>> >
>> > ] > (load "definitions.ss)
>> > It doesn't come back with ">"
>> > It just echoes the key-in and needs
>> > Ctl/Z to exit.
>>
>> Of course, since I didn't close the string (which shows that I didn't
>> copy-and-paste a real session), and you didn't notice it and correct it.
>>
> As a linux user that was my first suspicion.
> But it's such a lumbering monster, and you can't even edit the input line
> except by backspace. That's the main reason that I want to capture
> my prior key-ins.
Yes, emacs does that very well.
>> You cannot copy-and-paste blindly stuff you get from the Internet! You
>> have to understand it and correct it, at least when there are trivial
>> errors.
>>
>>
>> One way to avoid this kind of silly typoes, is to use emacs.
>> Put and evaluate:
>> (setq inferior-lisp "/path/to/your/mzscheme")
>> (defalias 'scheme 'inferior-lisp)
>> in ~/.emacs
>>
>> Then use M-x scheme RET to launch mzscheme.
>>
>> In the *inferior-lisp* buffer, standard emacs features are available,
>> such as paren matching and string colorization...
>>
> That's another layer on top of already bloat ?
emacs is small. 8MB. It's smaller than vim actually.
As an alternative, you could use rlwrap, if you just want line editing
(and history).
>> Why don't you read the documentation of mzscheme? Try:
>>
>> mzscheme --help
>>
> No, it's crap. Life is too short.
> I'm not using X, and I don't want to be a concert pianist.
> I want ONE key to start it running my previously saved work.
comp.lang.scheme is a programmer forum.
I've got no idea where users go to discuss...
--
__Pascal Bourguignon__
To enable readline support for the 'mzscheme' repl, you can follow the
instructions here:
http://docs.plt-scheme.org/readline/index.html
sam th
To go into interactive mode after loading a file, you want the '-i'
option:
> mzscheme -i -f X.ss
sam th
>But [mzScheme is] such a lumbering monster ...
mzScheme is a JIT compiler ... it takes a bit for the environment to
initialize. If you want an interpreter there are other schemes, but
few are so feature packed as the PLT package.
>... and you can't even edit the input line
>except by backspace. That's the main reason that I want to capture
>my prior key-ins.
As Sam mentioned you can enable readline support, or you can use
Emacs, or you can use the DrScheme GUI environment instead of running
mzScheme directly from the command line.
George
Based on my measurements, it takes about .15 seconds for the entire
mzscheme shell to come up. This is somewhat slower than say, Python,
but almost entirely because less is available at the initial Python
shell. When nothing is initially loaded at the mzscheme shell, it
comes up faster than Python.
sam th
The OP made a comment about possibly using an underpowered machine.
The current version of mzScheme (4.2.4) takes a couple seconds of
clock time to start on an old 600Mhz Pentium III. It runs fine but is
a bit slow as compared to my 2.8Ghz core-2 quad.
George
On the other hand, you don't boot a scheme much more often than an
emacs or a linux...
> (uptime)
uptime: 1 year, 10 hours, 34 minutes, 11 seconds.
31574051
(emacs-uptime)
--> ".EMACS: Up 556d 4h 10m 53s (Sun 2008-08-17 21:28:30), 34 buffers,
11 files"
% uptime
00:39:27 up 853 days, 20:18, 4 users, load average: 0.05, 0.01, 0.00
So who cares if it takes 0.15 s or 5 minutes...
--
__Pascal Bourguignon__
> On Wed, 24 Feb 2010 12:35:09 -0800 (PST), Sam TH <sam...@gmail.com>
> wrote:
>
>>Based on my measurements, it takes about .15 seconds for the entire
>>mzscheme shell to come up. This is somewhat slower than say,
>>Python, but almost entirely because less is available at the initial
>>Python shell. When nothing is initially loaded at the mzscheme
>>shell, it comes up faster than Python.
>
> The OP made a comment about possibly using an underpowered machine.
> The current version of mzScheme (4.2.4) takes a couple seconds of
> clock time to start on an old 600Mhz Pentium III. It runs fine but is
> a bit slow as compared to my 2.8Ghz core-2 quad.
What Sam was talking about is using something like
mzscheme -I scheme/base
with an empty .mzschemerc starts much faster than the default (which
is `-I scheme') and it's even slower to start if you use readline.
(But if I were using such an old machine, I would probably (a) worry
more about memory, (b) not consider slow startup times as something
exceptional.)
--
((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay:
http://barzilay.org/ Maze is Life!
Scheme seems to be conceptually minimalistic and neat.
So you're saying:
^
| /
| / <--- not a monster
| /
| / a monster
| / |
| / v
|-----------------------------------------------------
| /
| /
| /
|/
+----------------------------------------------------------->
Have you ever seen a picture of Gozilla?
--
__Pascal Bourguignon__