[movitz-devel] Re: Emacs on the metal

Shawn Betts sabetts at vcn.bc.ca
Sun Jun 5 17:24:44 UTC 2005


Frode Vatvedt Fjeld <ffjeld at common-lisp.net> writes:

>> Its a bit buggy on movitz :).
>
> If you have something like a list of movitz quirks, let me have it and
> I'll see if I can fix things now and then. (Patches are welcome too,
> obviously..) I suppose improved arrays are on the top of the list.

Here's a list of shortcuts I made to get lice working:

I couldn't figure out a way to get the lice files to load at the right
time. in los0.lisp it calls (genesis) at the end which initialised a
bunch of stuff and starts the repl. If I loaded my source before los0
then it'd keep rebooting. if i did it after, none of the variables
whose value was made by executing code would be initialized (they were
all NIL). I tried breaking genesis into 2 functions. The second one
I'd call from my lice lisp file. But then everytime i'd try to access
one my these variables it'd reboot. So I created an init function that
popuplated all the variables. Obviously lice doesn't need to be part
of the kernel. It could be loaded after the kernel is booted. But the
target lisp isn't complete enough..and where would it load lice from? :)

I had to hardcode the :size for make-hash-table, since they don't resize.

Since vectors aren't resizable I manually resized the buffer data
vector by creating a new, larger array, and copying the data
over. Maybe that's what happened behind the scenes anyway :).

In other cases where I accumulated data into an array with
vector-push-extend, I was able to hardcode the size of the array and
use a fill pointer.

In the display code I used a 1 dimensional array as a double buffer
and a second 2d array that was displaced to the 1d array. I had to
ditch the 2d array and just do the math myself to figure out where an
x,y coordinate mapped to.

I had a couple spots where I had to change the code because the
compiler couldn't "lend optional right now".

I had to comment out an s-expression because there's no
get-universal-time.

the lisp-interactive-mode didn't work because there's no
read-from-string, tho I found a simple-read-from-string, which would
probably work.

I found a weird bug, too. I can't seem to create a trivial function to
reproduce it though. basically, I have:

(defun foo ()
  (let (a)
    (labels ((do1 ()
		  ;; do stuff and then
		  (when <stuff>
		    (setf a <a struct>)))
	     (do2 ()
		  ;; recursively call do2, do stuff, and then call..
		  (do1)))
      (do2)
      a)))

and (foo) returns NIL instead of <a struct>. I'll keep looking into it
for now..

I also go a vector-push extending error in some cases when calling
format (I'm fairly certain it was because of format..but not 100%
sure). I wrote this to get around:

(defun fmt (fmt &rest args)
  "A movitz hack function. FORMAT sometimes gives an error, so i use this to get around it."
  (let ((s (make-array 100 :fill-pointer 0 :element-type 'character)))
    (apply #'format s fmt args)
    s))

Other than that it Just Worked :). There are still some places where I
get a vector-push extending error, which i haven't worked around yet.

-Shawn



More information about the movitz-devel mailing list