diff --git a/TODO.FACTOR.txt b/TODO.FACTOR.txt index 6991bde3eb..bd3f8851c7 100644 --- a/TODO.FACTOR.txt +++ b/TODO.FACTOR.txt @@ -1,18 +1,3 @@ -+ 0.83: - -- nasty inference regressions -- [ [ dup call ] dup call ] infer hangs -- the invalid recursion form case needs to be fixed, for inlines too -- windows port from erg -- editor: - - scroll to caret - - better listener multi-line expression handling - - history doesn't work in a good way if you ^K the input - - history: move caret to end - -- httpd search tools -- remaining HTML issues need fixing - + io: - unix i/o: problems with passing f to syscalls @@ -34,9 +19,6 @@ - support x11's large selections, if needed - own-selection violates ICCCM - one-column table doesn't need borders...? -[2:45pm] tathi: Factor's text display is a bit odd sometimes, until you mouse over (or click, if there's no "live" text) -[2:48pm] tathi: it appears to be using the font metrics from the sprite tuple, but re-using the texture from the previous letter -[2:59pm] tathi: hmm...and it looks like it's only be happening the first time you use a given character (from a given font face) - make-frame should compile - editor: - undo and redo @@ -47,6 +29,10 @@ - only redraw visible lines - more efficient multi-line inserts - editor should support stream output protocol + - scroll to caret + - better listener multi-line expression handling + - history doesn't work in a good way if you ^K the input + - history: move caret to end - finish gui stepper - cocoa: windows are not updated while resizing - graphical module manager tool @@ -104,6 +90,9 @@ + compiler/ffi: +- nasty inference regressions +- [ [ dup call ] dup call ] infer hangs +- the invalid recursion form case needs to be fixed, for inlines too - instead of decompiling words, add them to a 'recompile' set; compiler treats words in the recompile set as if they were not compiled - mac intel: struct returns from objc methods @@ -135,3 +124,5 @@ - code walker & exceptions -- test and debug problems - break: perhaps use current stdio to run break listener +- httpd search tools +- remaining HTML issues need fixing diff --git a/doc/handbook/changes.facts b/doc/handbook/changes.facts index 4634aa751c..4b6e3dbff5 100644 --- a/doc/handbook/changes.facts +++ b/doc/handbook/changes.facts @@ -11,6 +11,7 @@ ARTICLE: "changes" "Changes in the latest release" } { $subtopic "UI" { $list + "Multi-line text editor gadget replaces single-line editor gadget and adds support for selection, copy and paste, and more advanced text editing." "New apropos tool." "New word browser tool." { "New " { $link track } " gadget replaces the old " { $snippet "splitter" } "; it behaves similarly but supports more than two children." } @@ -53,6 +54,7 @@ ARTICLE: "changes" "Changes in the latest release" { $subtopic "Contributed libraries" { $list { "There is a new mechanism for loading contributed libraries that correctly handles dependencies; see " { $link "modules" } "." } + { "Time and date library added in " { $snippet "contrib/calendar/" } ". (Doug Coleman)" } "Factory window manager updates (Eduardo Cavazos)" { "New " { $snippet "slate" } " gadget for easier graphical output for simulations and demos. (Eduardo Cavazos)" } "Automata and boids demos. (Eduardo Cavazos)" diff --git a/library/compiler/inference/branches.factor b/library/compiler/inference/branches.factor index 5d01a2ed5e..e28ada7a25 100644 --- a/library/compiler/inference/branches.factor +++ b/library/compiler/inference/branches.factor @@ -35,7 +35,8 @@ namespaces parser prettyprint sequences strings vectors words ; "Unbalanced branches:" add* "\n" join inference-error ; : unify-effect ( in out -- in out ) - #! In is a sequence of integers; out is a sequence of stacks. + #! in is a sequence of integers, out is a sequence of + #! stacks. 2dup balanced? [ unify-stacks >r unify-in-d r> ] [ @@ -86,7 +87,7 @@ namespaces parser prettyprint sequences strings vectors words ; : infer-branch ( value -- namespace ) #! Return a namespace with inferencer variables: - #! meta-d, meta-c, d-in. They are set to f if + #! meta-d, meta-r, d-in. They are set to f if #! terminate was called. [ [ diff --git a/library/compiler/inference/inference.factor b/library/compiler/inference/inference.factor index 9faaddf707..41a2febc0c 100644 --- a/library/compiler/inference/inference.factor +++ b/library/compiler/inference/inference.factor @@ -52,6 +52,8 @@ SYMBOL: d-in #! After inference is finished, collect information. d-in get meta-d get length 2array ; +! Does this control flow path throw an exception, therefore its +! stack height is irrelevant and the branch will always unify? SYMBOL: terminated? : init-inference ( recursive-state -- ) @@ -85,7 +87,7 @@ M: f infer-quot ( f -- ) drop ; M: quotation infer-quot ( quot -- ) #! Recursive calls to this word are made for nested #! quotations. - [ terminated? get [ drop f ] [ apply-object t ] if ] all? drop ; + [ apply-object terminated? get not ] all? drop ; : infer-quot-value ( rstate quot -- ) recursive-state get >r swap recursive-state set diff --git a/library/test/benchmark/reverse-complement.factor b/library/test/benchmark/reverse-complement.factor index fa2f4834d8..5ba1dab362 100644 --- a/library/test/benchmark/reverse-complement.factor +++ b/library/test/benchmark/reverse-complement.factor @@ -2,29 +2,32 @@ IN: temporary USING: compiler hashtables io kernel math math namespaces sequences strings vectors words words ; -! Instead of a variable, we define an inline word which pushes -! the hash on the stack, for performance. -DEFER: trans-hash +DEFER: trans-map + +: add-translation \ trans-map get set-nth ; [ - 26 [ CHAR: A + dup set ] each - 26 [ CHAR: a + dup set ] each + 256 0 \ trans-map set + 26 [ CHAR: A + dup add-translation ] each + 26 [ dup CHAR: A + swap CHAR: a + add-translation ] each "TGCAAKYRMBDHV" "ACGTUMRYKVHDB" 2dup - [ set ] 2each - [ ch>lower set ] 2each -] make-hash + [ add-translation ] 2each + [ ch>lower add-translation ] 2each + + \ trans-map get +] with-scope -\ trans-hash swap unit define-compound -\ trans-hash t "inline" set-word-prop +\ trans-map swap unit define-compound +\ trans-map t "inline" set-word-prop : translate-seq ( seq -- sbuf ) [ - 2000000 building set + 30000000 building set [ % ] each - building get dup [ trans-hash hash ] inject + building get dup [ trans-map nth ] inject ] with-scope ; SYMBOL: out diff --git a/library/test/inference.factor b/library/test/inference.factor index 8375cf70d4..5bc6338455 100644 --- a/library/test/inference.factor +++ b/library/test/inference.factor @@ -208,11 +208,19 @@ DEFER: blah4 [ [ [ 1 ] [ ] bad-combinator ] infer ] unit-test-fails ! Regression + +! This order of branches works DEFER: do-crap : more-crap dup [ drop ] [ dup do-crap call ] if ; -: do-crap dup [ do-crap ] [ more-crap ] if ; +: do-crap dup [ more-crap ] [ do-crap ] if ; [ [ do-crap ] infer ] unit-test-fails +! This one does not +DEFER: do-crap* +: more-crap* dup [ drop ] [ dup do-crap* call ] if ; +: do-crap* dup [ do-crap* ] [ more-crap* ] if ; +[ [ do-crap* ] infer ] unit-test-fails + ! Regression : too-deep dup [ drop ] [ 2dup too-deep too-deep * ] if ; inline [ { 2 1 } ] [ [ too-deep ] infer ] unit-test @@ -267,10 +275,16 @@ DEFER: Y [ { 2 2 } ] [ [ X ] infer ] unit-test [ { 2 2 } ] [ [ Y ] infer ] unit-test +! Similar +DEFER: bar +: foo dup [ 2drop f f bar ] [ ] if ; +: bar [ 2 2 + ] t foo drop call drop ; + +[ [ foo ] infer ] unit-test-fails + [ 1234 infer ] unit-test-fails -! This hangs - +! This used to hang [ [ [ dup call ] dup call ] infer ] unit-test-fails ! This form should not have a stack effect diff --git a/library/tools/debugger.factor b/library/tools/debugger.factor index f5df43b504..0f05513880 100644 --- a/library/tools/debugger.factor +++ b/library/tools/debugger.factor @@ -116,6 +116,8 @@ M: condition error. delegate error. ; M: tuple error. ( error -- ) describe ; +M: string error. ( error -- ) print ; + M: object error. ( error -- ) . ; : :s ( -- ) error-continuation get continuation-data stack. ;