Paste: change object with quotation until it stops changing

Author: randy7
Mode: factor
Date: Sat, 30 May 2009 18:41:33
Plain Text |
: do-until-no-change ( obj quot: ( obj -- obj ) -- obj )
    dupd [ call( obj -- obj ) ] keep          ! obj1 obj2 quot
    [ 2dup = not ] dip          ! obj1 obj2 ? quot
    '[ nip _ do-until-no-change ] [ drop ] if ;

New Annotation

Summary:
Author:
Mode:
Body: