Subject: Mops FAQ
Date: 15 Jan 1996 10:21:35 +1100

==============  Mops FAQ - January '96 (current version: 2.7)  ================

G'day.  (I'm Australian, OK?)  Welcome to the Mops FAQ file.

Please read this before emailing me with a problem - answering lots of
individual email messages can take up a lot of time in which I could be
working on improving Mops, and I have to fit all this into the little
spare time I have anyway.

But if you have to email me, could you check a couple of things:

1. Double-check that you've looked at the section near the end called
"KNOWN BUGS IN 2.7, AND FIXES."

2. Put your email address at the end (OK if it's in a .sig).  Occasionally
I haven't been able to reply to someone because what looked like their
email address on the header of their message didn't work.  Anyway it's
harder for me to find it there.  Thanks.



I'll post this list every month or so.

--  Mike.



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



Q. What is Mops?

A. Mops is a public-domain development system for the Mac.  It's based on
Forth, with extensive OOP extensions, along the lines of Smalltalk.  It comes
with a class library which gives support for all the normal Mac interface
functions.  While not as full-featured as MacApp, say, it's very adequate for
the kind of applications which might be developed by one programmer.


Q. Where did it come from?

A. Mops is derived from Neon, which was one of the first languages for the
Mac that allowed actual development on the Mac itself.  It's a close cousin
to Yerk, which is a more "conservative" development of Neon, basically aimed
at keeping up with later Macs and systems while remaining fully compatible
with Neon.  Mops is more "radical".  It's a complete reimplementation which
compiles native (68K) code instead of the usual Forth threaded variety.  It's
very fast -- about as fast as anything on the Mac in fact.  It has a few
other improvements over the original Neon, such as multiple inheritance,
and temporary (local) objects.


Q. Where can I get it?

A. WWW:   <URL:http://www.netaxs.com/~jayfar/mops.html>
       (thanks to Jayfar (Jay Farrell) for starting this page - please let
        him know of any other links that might be useful - jayfar@netaxs.com)

   ftp: //taygeta.com/pub/Forth/Mops
       (taygeta is the main Forth ftp site)

The Mops files are Mops27.sea.bin (the system) and Mops26m.sea (the manual,
which is still the 2.6 manual).

Note that I haven't updated the manual yet, since 2.7 just contains one major
new feature, which is documented in the 2.7 release notes.


Some other Mops code is available on the taygeta site, and there are links
in the WWW page.

taygeta is the main site -- I always make sure the latest version is there.
I can't always ensure this for other places where Mops might be located.



Q. Do you have any other sample code available, apart from what's at those
locations?

A. Sorry, I can't help much.  I've only written one "real" Mops application
myself, and I'm not free to distribute the source.  Most of my Mops time
has been spent on developing it rather than writing applications in it.

If the above ftp and WWW sites don't have what you want, try posting on
comp.lang.forth.mac - maybe somebody else there can help.


Q. Does the Mops manual really have to be in MicroSoft Word format?  Could it
be made available in other formats?

A. It's in Word format for historical reasons - also Word is still very
widely used and easily convertible to other platforms.  If anyone feels
strongly about this, how about volunteering to convert it to your favorite
format and upload it to the taygeta ftp site?


Q. Could I learn Mac programming with Mops?

A. Definitely.  It comes with an on-line manual, which is derived from the
original Neon manual.  This assumes a very basic level of knowledge about
programming, and none about the Mac.


Q. Could I learn OOP with Mops?

A. Definitely! - for the same reason as in the last question.  OOP was
still very new when Neon came out, so the manual explains everything from
a very basic level.


Q. Can I write XFCNs or XCMDs for HyperCard, or AppleScript Extensions for Apple
Script, or Extensions, or Control Panels in Mops?

No, sorry, you can't do it.  Mops only does applications.  It would need quite
a bit of restructuring to be able to handle non-application bits of code
like XCMDs.  I thought about doing something about this a couple of years
ago but it wasn't a priority, and now with Power Macs and the Shared
Library Manager I think the days of these sorts of things are numbered,
so from my point of view it just wouldn't be worth the effort.

On the Power Mac everything's done via shared libraries, and my future
Power Mac version of Mops (see below) will fully support this.  So that's
my number one priority right now.


Q. I double-clicked the application "Mops", but just got a window with no
menus.

A. You didn't read the Readme.1st file!  To save download time, only the
Mops "nucleus" is included.  You have all the source there, so you have
to compile up the full system from the source by following the instructions
in the Readme.1st file.  It's easy.


Q.  I followed the instructions and started to compile the system, but got
a crash.

A.  This is possibly a conflict with some extension you have running.  We've
had problems with SAM (Symantec Anti-virus for Macintosh) and RamDoubler.
Try it again with extensions off (reboot with the shift key down).  Mops
ought to then compile up OK.  You might also be able to turn your extensions
on again afterwards.  But if the conflict persists with the fully-compiled Mops
system, see if you can isolate which particular extension is causing the
problem, and let me know.

By the way, antivirus software is often not very friendly to compilers,
since compilers do things to resources that the antivirus program might
think is virus activity.  But I use Disinfectant all the time, and have
never had any problems with it.


Q. I compiled up the Mops system OK, but now when I type lines into the Mops
window, nothing happens - the text just sits there.

A. Maybe you've been using an earlier Mops version, but anyway, when you got
2.7 you didn't read the Readme.1st file.  Please do.  The interface isn't
the same.  Now that we have a proper editing window, typing RETURN just starts
a new line.  You have to type ENTER to cause execution (this is what MPW does
as well).  Some applications treat ENTER and RETURN as equivalent, but not
Mops.  Along with the new interface, there's also much more extensive
communication with Quick Edit, which you won't want to miss.


Q. Q. I compiled up the Mops system OK, but when I double-click on Mops.dic,
I get a crash.

A. The most usual cause of this is that you are upgrading from an earlier
version of Mops, and you still have a copy of the earlier Mops nucleus
around.  From the Mac's point of view, "Mops.dic" is a document belonging
to the application "Mops".  When you double-click on "Mops.dic", the Mac
system launches the application "Mops", but if you have two versions of
Mops around, you can't be sure that it will fire up the latest.  In fact,
it probably won't.  As the location of words in the nucleus will be different
between versions, you can't have a new dictionary running on top of an old
nucleus - you'll just get a crash.  So trash the old nucleus (if you're the
cautious type, you can save it onto a floppy first, then eject the floppy).
That way, the Mac is forced to fire up the right version of Mops.


Q. My code works fine in the Mops environment, but when I install it as an
application strange things happen.

A. There are a couple of things that could be wrong here.  A common source of
problems can arise if at compile time you're ticking words, and comma-ing the
resulting execution tokens into a table, then at run time executing the words
via  @ EXECUTE.  This might happen, e.g. if you're porting your application
from another Forth.

In Mops there's no problem with storing an xt at run time then using it later,
but it's highly dangerous to store it at compile time, save it with the
dictionary, then later try to load the dictionary and use the xt.  This is
because in Mops an xt is simply an absolute address, and absolute addresses
of locations in your code will probably change between runs, depending on where
Mops or your application happens to load into the Mac's memory.

The best way to handle this kind of operation is with a DicAddr, X-Addr or
X-Array object.  Please see the section "Addresses--relocatable and absolute"
in Part II of the manual.


Q. I tried to run Mops, but it didn't work.

A. AAUUGGHHHH!!!  Call this a bug report?  I don't.  Yet I actually do
occasionally get messages like this!

Please give me enough information so that at least I might have a fighting
chance of telling what happened.  I probably don't need to know what kind of
Mac or system you're running, since Mops should run on just about anything.
But what I really need to know is:

1. What version of Mops have you got?
2. What did you actually DO to try to run it?  Did you double-click
anything?  What?  Exactly what happened then?  That sort of thing.

Remember, I'm not a mind-reader!


Q. Can I use color in a Mops window?

A. You have to make the window a color window.  The Window class now has a
new ivar, color?, and a method to set it, setColor: which takes a boolean
flag.  So before you send new: or getNew: to your window, do

true setColor: myWindow

Then when you send new: or getNew:, the window will be created as a color
window.


Q. How do I plot an Icon / use the Sound Manager / use an offscreen PixMap
   (insert favorite problem here).

A. Well, if this is a general Mac programming problem rather than something
specifically to do with Mops, I'm not really here to answer this sort of
question.  Try posting on comp.sys.mac.programmer.help.  I have to try
developing the next version of Mops in my spare time, so it's probably not
right for me to be taking time to answer basic Mac programming questions.
I don't have all the answers anyway.  I'm certainly not a substitute for
Inside Mac.  Read the appropriate parts first, and if you're still stuck,
try the newsgroup.  There are plenty of people willing and able to help there.


Q. I've written this nifty code, and I'd like you to look at it and tell me
what you think.

A. I'd rather you didn't ask me that.  If everybody did that I'd get buried
in email and never get anything done.  I'm doing this in my spare time, remember
.
Maybe consider posting it to comp.lang.forth.mac.


Q. What's the minimum system I need to run Mops?

A. Mac Plus or 512KE, 2 megs RAM, 4 megs spare hard disk space.


Q. You're joking, surely?

A. No I'm not!


Q. Will a future Mops version compile native code for the Power Mac?

A. I hope so.  I'm working on it, but it's a big job.  It will certainly
take me well into this year.


Q. What about a Windows version?

A. A couple of people have contacted me, who thinking about looking at this.
If anybody else is interested, let me know, and I'll pass on contact information
.

But it will be quite a big job.  It could possibly be built on top of an
existing Windows Forth, but the hard part would be modifying all the classes
to connect to the Windows API instead of the Mac.

I can't really give any further help, since I don't have time, and in any
case I've never programmed for Windows.


Q. Will you continue to support Mops for some time to come?

A. I've been doing it for 6 years now, and don't plan to stop!


Q. Why an oddball language that isn't C++?

A. Try it and see how quickly you can get things done.  The most popular
way isn't always the best way.  After all, you're using a Mac, aren't you?




----------------------- KNOWN BUGS IN 2.7, AND FIXES -------------------------

There don't seem to be any yet!!


I'll add to this list if (when?) new bugs are discovered.


------------------------------------------------------------------------
Mike Hore            mikeh@zeta.org.au                           _--_|\
                     (no longer on Compuserve)                  /      \
                                                                \_.--._x
Aug 24, 1995 - the day Micro$oft released Windows 95 to               v
millions of unsuspecting beta-testers.
------------------------------------------------------------------------

