]> gitweb.factorcode.org Git - factor.git/commitdiff
Merge branch 'master' of git://factorcode.org/git/factor
authorSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Thu, 26 Mar 2009 23:20:30 +0000 (18:20 -0500)
committerSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Thu, 26 Mar 2009 23:20:30 +0000 (18:20 -0500)
Factor.app/Contents/Frameworks/libfreetype.6.dylib [deleted file]
basis/help/tips/tips-docs.factor
basis/help/tips/tips.factor

diff --git a/Factor.app/Contents/Frameworks/libfreetype.6.dylib b/Factor.app/Contents/Frameworks/libfreetype.6.dylib
deleted file mode 100755 (executable)
index 381e74b..0000000
Binary files a/Factor.app/Contents/Frameworks/libfreetype.6.dylib and /dev/null differ
index 8d732c55680ae0ff60ae0150c0a3200f83bc6dca..750eff7a52b7d8b1fda97ef0ba5c1427f5873434 100644 (file)
@@ -17,7 +17,14 @@ TIP: "You can write documentation for your own code using the " { $link "help" }
 TIP: "You can write graphical applications using the " { $link "ui" } "." ;
 
 TIP: "Power tools: " { $links see edit help about apropos time infer. } ;
+
+TIP: "Tips of the day implement the " { $link "definition-protocol" } " and new tips of the day can be defined using the " { $link POSTPONE: TIP: } " parsing word." ;
+
+HELP: TIP:
+{ $syntax "TIP: content ;" }
+{ $values { "content" "a markup element" } }
+{ $description "Defines a new tip of the day." } ;
+  
 ARTICLE: "all-tips-of-the-day" "All tips of the day"
 { $tips-of-the-day } ;
 
index 8d173ce533a2348885a8c55d259c355f5a266b9e..311ab46a205355c90f4c3649c994d25102e813cc 100644 (file)
@@ -1,16 +1,30 @@
 ! Copyright (C) 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: parser arrays namespaces sequences random help.markup kernel io
-io.styles colors.constants ;
+io.styles colors.constants definitions accessors ;
 IN: help.tips
 
 SYMBOL: tips
 
 tips [ V{ } clone ] initialize
 
-SYNTAX: TIP: parse-definition >array tips get push ;
+TUPLE: tip < identity-tuple content loc ;
 
-: a-tip ( -- tip ) tips get random ;
+M: tip forget* tips get delq ;
+
+M: tip where loc>> ;
+
+M: tip set-where (>>loc) ;
+
+: <tip> ( content -- tip ) f tip boa ;
+
+: add-tip ( tip -- ) tips get push ;
+
+SYNTAX: TIP:
+    parse-definition >array <tip>
+    [ save-location ] [ add-tip ] bi ;
+
+: a-tip ( -- tip ) tips get random content>> ;
 
 SYMBOL: tip-of-the-day-style
 
@@ -35,4 +49,4 @@ H{
 : tip-of-the-day. ( -- ) { $tip-of-the-day } print-content nl ;
 
 : $tips-of-the-day ( element -- )
-    drop tips get [ nl nl ] [ print-element ] interleave ;
\ No newline at end of file
+    drop tips get [ nl nl ] [ content>> print-element ] interleave ;
\ No newline at end of file