commit ff25e9ab3f22c00225e6d185575fdcec2c49f7eb Spenser Truex <spensertruexonline@gmail.com> 2019-06-22 21:05:30 -0700 Pure pandoc
.gitignore | 3 ++- README.org | 32 ++++++++++---------------------- eforth.el | 38 +++++++++++++++----------------------- 3 files changed, 27 insertions(+), 46 deletions(-)
diff --git a/.gitignore b/.gitignore index c580a9a..1793830 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ *~ *.html -*.pandoc \ No newline at end of file +*.pandoc +png32* \ No newline at end of file diff --git a/README.org b/README.org index bafd536..2d2f750 100644 --- a/README.org +++ b/README.org @@ -1,8 +1,8 @@ #+TITLE: eForth #+AUTHOR: Spenser Truex #+EMAIL: web@spensertruex.com - **** Version 0.0.1 +Docs available as: [[https://spensertruex.com/eforth][HTML]] | [[https://github.com/equwal/eforth/blob/master/README.org][PDF]] | [[https://github.com/equwal/eforth/blob/master/eforth.el][Plain Text]] This is an implementation of an elisp-based FORTH. This means that elisp is used to write the function definitions. In fact, no FORTH function @@ -25,9 +25,9 @@ Domain Specific Language the programmer defines. (cf . make-frame-command) (nf . other-frame)) (cf del r r wr wr r d wr d wl wl d wl d wr n - wr n wr n wl wl wl wd n wr n wr n wr n wl wl wl wu nf))) + wr n wr n wl wl wl wd n wr n wr n wr n wl + wl wl wu nf))) #+END_SRC - * How does a FORTH work? Forth code is gone through by the pointer moving through the call stack. When a non-function is found, it is added to the argument stack. When a function is @@ -39,25 +39,7 @@ in total), the best option seemeed to be obviously to create a miniature language with 1 or 2 letter abbreviations for each. Any arguments to a function can be passed before it in the list, and there is no need to define a return stack. -* Usage: example: -#+BEGIN_SRC emacs-lisp :tangle no -(require 'eforth) -(defun 8pan () - (interactive) - (eforth '((n . (lambda () (switch-to-buffer nil))) - (d . split-window-below) - (r . split-window-right) - (wr . windmove-right) - (wl . windmove-left) - (wd . windmove-down) - (wu . windmove-up) - (del . delete-other-windows) - (cf . make-frame-command) - (nf . other-frame)) - (cf del r r wr wr r d wr d wl wl d wl d wr n - wr n wr n wl wl wl wd n wr n wr n wr n wl - wl wl wu nf))) -#+END_SRC + =M-x 8pan= will produce a new frame with eight panels (emacs-speak: "windows"). Here is how it works: @@ -95,6 +77,12 @@ compiler is in fact a trivial exercise. * Drawbacks ** Elispers might not want to read your eFORTH code ** eForth is not stable +Forth is [[http://www.flownet.com/gat/jpl-lisp.html][space-age technology]], and eForth is young. Send a pull request. ** Isn't verbose code self-documenting? NO. Documented code is documented. Using short names with the bindings handily available in the same form is equally explicit as writing them out every time. + +* Contributing +Please make sure your contributions are [[https://github.com/melpa/melpa/blob/master/CONTRIBUTING.org][melpa]]-friendly, and documented in the +README. You can use [[http://joostkremers.github.io/pandoc-mode/][pandoc-mode]] to transform the README.org into plaintext `;;; +Commentary:`. diff --git a/eforth.el b/eforth.el index 37d06a6..2c70c29 100644 --- a/eforth.el +++ b/eforth.el @@ -13,6 +13,9 @@ ;; Licensed with the GNU GPL v3 see: ;; <https://www.gnu.org/licenses/>. ;;; Commentary: +;; Version 0.0.1 +;; +;; Docs available as: HTML | PDF | Plain Text ;; ;; This is an implementation of an elisp-based FORTH. This means that elisp ;; is used to write the function definitions. In fact, no FORTH function @@ -59,28 +62,6 @@ ;; arguments to a function can be passed before it in the list, and there ;; is no need to define a return stack. ;; -;; -;; -;; USAGE: EXAMPLE: -;; -;; -;; (require 'eforth) -;; (defun 8pan () -;; (interactive) -;; (eforth '((n . (lambda () (switch-to-buffer nil))) -;; (d . split-window-below) -;; (r . split-window-right) -;; (wr . windmove-right) -;; (wl . windmove-left) -;; (wd . windmove-down) -;; (wu . windmove-up) -;; (del . delete-other-windows) -;; (cf . make-frame-command) -;; (nf . other-frame)) -;; (cf del r r wr wr r d wr d wl wl d wl d wr n -;; wr n wr n wl wl wl wd n wr n wr n wr n wl -;; wl wl wu nf))) -;; ;; M-x 8pan will produce a new frame with eight panels (emacs-speak: ;; "windows"). Here is how it works: ;; @@ -129,12 +110,23 @@ ;; ;; eForth is not stable ;; +;; Forth is space-age technology, and eForth is young. Send a pull request. +;; ;; ;; Isn't verbose code self-documenting? ;; ;; NO. Documented code is documented. Using short names with the bindings ;; handily available in the same form is equally explicit as writing them ;; out every time. +;; +;; +;; +;; CONTRIBUTING +;; +;; +;; Please make sure your contributions are melpa-friendly, and documented +;; in the README. You can use pandoc-mode to transform the README.org into +;; plaintext `;;; Commentary:`. ;;; Code: (require 'cl-lib) @@ -163,4 +155,4 @@ LIST is the forth's stack." (provide 'eforth) -;Internal function for the `eforth' macro.ends here + ;Internal function for the `eforth' macro.ends here