Skip to content
Snippets Groups Projects
Commit 43dccab1 authored by ram's avatar ram
Browse files

Fixed line hackery to work in new compiler (and be portable too..).

parent c0aca92f
No related branches found
No related tags found
No related merge requests found
...@@ -36,9 +36,10 @@ ...@@ -36,9 +36,10 @@
;;;; The line object: ;;;; The line object:
(proclaim '(inline %make-line))
(defstruct (line (:print-function %print-hline) (defstruct (line (:print-function %print-hline)
(:predicate linep) (:constructor %make-line)
(:constructor nil)) (:predicate linep))
"A Hemlock line object. See Hemlock design document for details." "A Hemlock line object. See Hemlock design document for details."
;; ;;
;; Something that represents the contents of the line. This is ;; Something that represents the contents of the line. This is
...@@ -130,22 +131,6 @@ ...@@ -130,22 +131,6 @@
(line-%chars line)) (line-%chars line))
;;; Fast version of Make-Line does keyword hacking at compile time.
;;;
(defmacro make-line (&key chars previous next marks %buffer number
plist #+Buffered-Lines buffered-p)
`(lisp::%sp-set-vector-subtype
(vector 'line
,chars
,previous
,next
,marks
,%buffer
,number
,plist
#+Buffered-Lines ,buffered-p)
1))
;;; Return a copy of Line in buffer Buffer with the same chars. We use ;;; Return a copy of Line in buffer Buffer with the same chars. We use
;;; this macro where we want to copy a line because it takes care of ;;; this macro where we want to copy a line because it takes care of
;;; the case where the line is buffered. ;;; the case where the line is buffered.
...@@ -158,6 +143,11 @@ ...@@ -158,6 +143,11 @@
#+Buffered-Lines :buffered-p #+Buffered-Lines :buffered-p
#+Buffered-Lines (line-buffered-p ,line))) #+Buffered-Lines (line-buffered-p ,line)))
;;; Hide the fact that the slot isn't really called CHARS.
;;;
(defmacro make-line (&rest keys)
`(%make-line ,@(substitute :%chars :chars keys)))
(defmacro line-length* (line) (defmacro line-length* (line)
"Returns the number of characters on the line, but it's a macro!" "Returns the number of characters on the line, but it's a macro!"
`(cond ((eq ,line open-line) `(cond ((eq ,line open-line)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment