]> gitweb.factorcode.org Git - factor.git/commitdiff
fix stack bug in presentations; minor tweak to menu code
authorSlava Pestov <slava@factorcode.org>
Sat, 3 Sep 2005 21:49:28 +0000 (21:49 +0000)
committerSlava Pestov <slava@factorcode.org>
Sat, 3 Sep 2005 21:49:28 +0000 (21:49 +0000)
CHANGES.html
TODO.FACTOR.txt
doc/handbook.tex
library/collections/sequences-epilogue.factor
library/inference/call-optimizers.factor
library/inference/kill-literals.factor
library/inference/optimizer.factor
library/ui/menus.factor
library/ui/presentations.factor

index 54b562662a2d04d776f235caa40714ca7ddddd68..5ab313438fadbddc09536a416029ff6f20557f13 100644 (file)
@@ -41,6 +41,8 @@ make-string  ==&gt; "" make
 make-rstring ==&gt; "" make reverse
 make-sbuf    ==&gt; SBUF" " make
 </pre></li>
+<li>The <code>every?</code> word has been replaced with <code>monotonic? ( seq quot -- ? )</code>. Its behavior is a superset of <code>every?</code> -- it now accepts any transitive relation, and checks if the sequence is monotonic under this relation. For example,
+<code>[ = ] monotonic?</code> checks if all elements in a sequence are equal, and <code>[ < ] monotonic?</code> checks for a strictly increasing sequence of integers.</li> 
 </ul>
 
 </li>
@@ -58,6 +60,18 @@ make-sbuf    ==&gt; SBUF" " make
 
 </li>
 
+<li>User interface:
+
+<ul>
+<li>Binary search is now used for spacial indexing where possible. This improves performance when there are a lot of lines of output in the listener.</li>
+<li>Scroll bars now behave in a more intuitive manner, closer to conventional GUIs.</li>
+<li>Menus now appear when the mouse button is pressed, not released, and dragging through the menu with the button held down behaves as one would expect.</li>
+<li>The data stack and call stack are now shown. In the single-stepper, these two display the state of the program being stepped. In the inspector, the call stack display is replaced with an inspector history.</li>
+<li>Pack layouts with gaps are now supported.</li>
+<li>Many bug fixes.</li>
+</ul>
+
+</li>
 
 <li>Everything else:
 
@@ -67,7 +81,7 @@ make-sbuf    ==&gt; SBUF" " make
 <li>New <code>cond ( conditions -- )</code> combinator. It behaves like a set of nested <code>ifte</code>s, and compiles if each branch has the same stack effect. See its documentation comment for details.</li>
 <li>Formally documented method combination (<code>G:</code> syntax) in handbook.
 <li>Erlang/Termite-style concurrency library in <code>contrib/concurrency</code> (Chris Double).</li>
-<li>Completely redid infix algebra in <code>conrib/algebra/</code>. Now, vector operations are possible
+<li>Completely redid infix algebra in <code>contrib/algebra/</code>. Now, vector operations are possible
 and the syntax doesn't use so many spaces. New way to write the quadratic formula:
 <pre>MATH: quadratic[a;b;c] =
     plusmin[(-b)/2*a;(sqrt(b^2)-4*a*c)/2*a] ;</pre>
index ce598e3bef0e2d966a22ad93ee52a17164c46073..8b7b2844fedf6e32a492788777d0565767effafb 100644 (file)
@@ -1,7 +1,6 @@
-- fix up the min thumb size hack\r
-\r
 + ui:\r
 \r
+- fix up the min thumb size hack\r
 - long lines of text fail in draw-surface\r
 - only redraw dirty gadgets\r
 - faster mouse tracking\r
index a8bf7729ff5e467330fab5e33f7fdb8eeb00806e..66012942436c25df8bc6a3b654040aeaf9926d6a 100644 (file)
@@ -2624,7 +2624,7 @@ Applies the quotation to each element of the sequence. If an element is found fo
 Outputs \texttt{t} if the quotation yields true when applied to each element, otherwise outputs \texttt{f}. Given an empty sequence, vacuously outputs \texttt{t}.
 \wordtable{
 \vocabulary{sequences}
-\ordinaryword{every?}{every?~( seq quot -- ?~)}
+\ordinaryword{monotonic?}{monotonic?~( seq quot -- ?~)}
 \texttt{quot:~element element -- ?}\\
 }
 Tests if all elements of the sequence are equivalent under the relation. The quotation should be an equality relation (see \ref{equality}), otherwise the result will not be useful. This is implemented by vacuously outputting \verb|t| if the sequence is empty, or otherwise, by applying the quotation to each element together with the first element in turn, and testing if it always yields a true value. Usually, this word is used to test if all elements of a sequence are equal, or the same element:
index 1c19ad098d915643ca5ab510cea0367995bc525b..5f917f1ce5fb19d8205460e42ceacaadbabf307c 100644 (file)
@@ -113,9 +113,6 @@ M: object empty? ( seq -- ? ) length 0 = ;
 
 M: object >list ( seq -- list ) dup length 0 rot (>list) ;
 
-: conjunction ( v -- ? ) [ ] all? ; flushable
-: disjunction ( v -- ? ) [ ] contains? ; flushable
-
 : index   ( obj seq -- n )     [ = ] find-with drop ; flushable
 : index*  ( obj i seq -- n )   [ = ] find-with* drop ; flushable
 : member? ( obj seq -- ? )     [ = ] contains-with? ; flushable
index f4768b2e9f11c4756bada509663ba8dfac9da6bc..66db22caad78acbf4ff9c2e472e1546071401917 100644 (file)
@@ -62,7 +62,7 @@ SYMBOL: @
 : literals-match? ( values template -- ? )
     [
         over literal? [ >r literal-value r> ] [ nip @ ] ifte =
-    ] 2map conjunction ;
+    ] 2map [ ] all? ;
 
 : values-match? ( values template -- ? )
     [ @ = [ drop f ] unless ] 2map [ ] subset [ eq? ] monotonic? ;
index 61a0b1dcf77eccd41de093a348360a2d741ebfac..4a5e08bb13e4dd3cd4f7511b3f3cefffc7ca0802 100644 (file)
@@ -77,7 +77,7 @@ M: #call can-kill? ( literal node -- ? )
     [ swap memq? ] map-with ;
 
 : lookup-mask ( mask word -- word )
-    over disjunction [ (kill-shuffle) hash ] [ nip ] ifte ;
+    over [ ] contains? [ (kill-shuffle) hash ] [ nip ] ifte ;
 
 : kill-shuffle ( literals node -- )
     #! If certain values passing through a stack op are being
index 29f9479902c1d4dace4345caab8c8efd715e23e4..5d0a0bf1086462f2589a6adadb40d63d130a437f 100644 (file)
@@ -81,16 +81,6 @@ M: #values optimize-node* ( node -- node/t )
 M: #return optimize-node* ( node -- node/t )
     optimize-fold ;
 
-! #label
-GENERIC: calls-label* ( label node -- ? )
-
-M: node calls-label* 2drop f ;
-
-M: #call-label calls-label* node-param eq? ;
-
-: calls-label? ( label node -- ? )
-    [ calls-label? not ] all-nodes-with? not ;
-
 ! M: #label optimize-node* ( node -- node/t )
 !     dup node-param over node-children first calls-label? [
 !         drop t
index 902c6b7592c560a612b7e111c9303858940e672e..a1dd4f3d299aa36bb22ac01ebd25b14481b6f8d1 100644 (file)
@@ -7,10 +7,8 @@ gadgets-labels generic kernel lists math namespaces sequences ;
 : retarget-drag ( -- )
     hand [ rect-loc world get pick-up ] keep
     2dup hand-clicked eq? [
-        2drop
-    ] [
-        [ set-hand-clicked ] keep update-hand
-    ] ifte ;
+        2dup set-hand-clicked dup update-hand
+    ] unless 2drop ;
 
 : menu-actions ( glass -- )
     dup [ drop retarget-drag ] [ drag 1 ] set-action
index 6f15c8f0f4408c332761f382a8aee026879e0800..5ddad8afd59812c14dbd540288f0b566573ae1d2 100644 (file)
@@ -18,6 +18,7 @@ SYMBOL: commands
 
 : command-quot ( presented quot -- quot )
     [
+        \ drop ,
         [ swap literalize , % ] [ ] make ,
         [ pane get pane-call ] %
     ] [ ] make ;