Hello,

I'm recently experimenting with Mozart a lot. I found myself constantly switching between OPI and external ozc calls/makefiles. I tried to follow the style "first propotype in OPI, then code functors separately" but I find this constraining, as I'd like to use OPI also for debugging of already separated functors. So I wrote a small emacs function to feed a functor expression into OPI by temporary adding:
declare [M]={Apply [ <functor text in a buffer> ]}
to an emacs buffer, then undoing the change so that the functor file remains untouched.

I think you may find this style of development useful. Here's the function, bind it to your keystroke of choice and enjoy:

(defun oz-feed-functor ()
  (interactive)
  (setq oz-cur-point (point))
  (goto-char (point-min))
  (undo-boundary)
  (insert "declare [M]={Apply [")
  (goto-char (point-max))
  (insert "\r\n]}")
  (oz-feed-region (point-min) (point-max))
  (undo-boundary)(undo)
  ;; now remove from undo list until nearest nil (= boundary) 2 times:
  (while (pop buffer-undo-list))
  (while (pop buffer-undo-list))
  (goto-char oz-cur-point))

cheers

_________________________________________________________________________________
mozart-users mailing list                               
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users

Reply via email to