Merge branch 'master' of git://factorcode.org/git/factor
commit
5ef537b752
|
@ -1,6 +1,6 @@
|
||||||
USING: definitions kernel parser words sequences math.parser
|
USING: definitions kernel parser words sequences math.parser
|
||||||
namespaces editors io.launcher windows.shell32 io.files
|
namespaces editors io.launcher windows.shell32 io.files
|
||||||
io.paths strings unicode.case ;
|
io.paths strings unicode.case make ;
|
||||||
IN: editors.editpadpro
|
IN: editors.editpadpro
|
||||||
|
|
||||||
: editpadpro-path
|
: editpadpro-path
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
USING: editors io.files io.launcher kernel math.parser
|
USING: editors io.files io.launcher kernel math.parser
|
||||||
namespaces sequences windows.shell32 ;
|
namespaces sequences windows.shell32 make ;
|
||||||
IN: editors.editplus
|
IN: editors.editplus
|
||||||
|
|
||||||
: editplus-path ( -- path )
|
: editplus-path ( -- path )
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
USING: definitions io.launcher kernel parser words sequences math
|
USING: definitions io.launcher kernel parser words sequences math
|
||||||
math.parser namespaces editors ;
|
math.parser namespaces editors make ;
|
||||||
IN: editors.emacs
|
IN: editors.emacs
|
||||||
|
|
||||||
: emacsclient ( file line -- )
|
: emacsclient ( file line -- )
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
USING: editors hardware-info.windows io.files io.launcher
|
USING: editors hardware-info.windows io.files io.launcher
|
||||||
kernel math.parser namespaces sequences windows.shell32 ;
|
kernel math.parser namespaces sequences windows.shell32
|
||||||
|
make ;
|
||||||
IN: editors.emeditor
|
IN: editors.emeditor
|
||||||
|
|
||||||
: emeditor-path ( -- path )
|
: emeditor-path ( -- path )
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
USING: io.backend io.files kernel math math.parser
|
USING: io.backend io.files kernel math math.parser
|
||||||
namespaces sequences system combinators
|
namespaces sequences system combinators
|
||||||
editors.vim vocabs.loader ;
|
editors.vim vocabs.loader make ;
|
||||||
IN: editors.gvim
|
IN: editors.gvim
|
||||||
|
|
||||||
SINGLETON: gvim
|
SINGLETON: gvim
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
USING: editors io.files io.launcher kernel math.parser
|
USING: editors io.files io.launcher kernel math.parser
|
||||||
namespaces sequences windows.shell32 ;
|
namespaces sequences windows.shell32 make ;
|
||||||
IN: editors.notepadpp
|
IN: editors.notepadpp
|
||||||
|
|
||||||
: notepadpp-path
|
: notepadpp-path
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
! if not on the path.
|
! if not on the path.
|
||||||
!
|
!
|
||||||
USING: io.files io.launcher kernel namespaces math
|
USING: io.files io.launcher kernel namespaces math
|
||||||
math.parser editors sequences windows.shell32 ;
|
math.parser editors sequences windows.shell32 make ;
|
||||||
IN: editors.scite
|
IN: editors.scite
|
||||||
|
|
||||||
: scite-path ( -- path )
|
: scite-path ( -- path )
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
USING: editors io.files io.launcher kernel math.parser
|
USING: editors io.files io.launcher kernel math.parser
|
||||||
namespaces sequences windows.shell32 ;
|
namespaces sequences windows.shell32 make ;
|
||||||
IN: editors.ted-notepad
|
IN: editors.ted-notepad
|
||||||
|
|
||||||
: ted-notepad-path
|
: ted-notepad-path
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
USING: definitions io.launcher kernel math math.parser parser
|
USING: definitions io.launcher kernel math math.parser parser
|
||||||
namespaces prettyprint editors ;
|
namespaces prettyprint editors make ;
|
||||||
|
|
||||||
IN: editors.textmate
|
IN: editors.textmate
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
! Copyright (C) 2008 Ben Schlingelhof.
|
! Copyright (C) 2008 Ben Schlingelhof.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: definitions io.launcher kernel parser words sequences
|
USING: definitions io.launcher kernel parser words sequences
|
||||||
math math.parser namespaces editors ;
|
math math.parser namespaces editors make ;
|
||||||
IN: editors.textwrangler
|
IN: editors.textwrangler
|
||||||
|
|
||||||
: tw ( file line -- )
|
: tw ( file line -- )
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
USING: editors io.files io.launcher kernel math.parser
|
USING: editors io.files io.launcher kernel math.parser
|
||||||
namespaces sequences windows.shell32 ;
|
namespaces sequences windows.shell32 wne ;
|
||||||
IN: editors.ultraedit
|
IN: editors.ultraedit
|
||||||
|
|
||||||
: ultraedit-path ( -- path )
|
: ultraedit-path ( -- path )
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
USING: definitions io io.launcher kernel math math.parser
|
USING: definitions io io.launcher kernel math math.parser
|
||||||
namespaces parser prettyprint sequences editors accessors ;
|
namespaces parser prettyprint sequences editors accessors
|
||||||
|
make ;
|
||||||
IN: editors.vim
|
IN: editors.vim
|
||||||
|
|
||||||
SYMBOL: vim-path
|
SYMBOL: vim-path
|
||||||
|
|
|
@ -5,3 +5,7 @@ USING: math.vectors tools.test ;
|
||||||
[ { 1 2 3 } ] [ { 2 4 6 } 1/2 v*n ] unit-test
|
[ { 1 2 3 } ] [ { 2 4 6 } 1/2 v*n ] unit-test
|
||||||
[ { 1 2 3 } ] [ { 2 4 6 } 2 v/n ] unit-test
|
[ { 1 2 3 } ] [ { 2 4 6 } 2 v/n ] unit-test
|
||||||
[ { 1/1 1/2 1/3 } ] [ 1 { 1 2 3 } n/v ] unit-test
|
[ { 1/1 1/2 1/3 } ] [ 1 { 1 2 3 } n/v ] unit-test
|
||||||
|
|
||||||
|
[ 4 ] [ { 1 2 } norm-sq ] unit-test
|
||||||
|
[ 36 ] [ { 2 3 } norm-sq ] unit-test
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
! Copyright (C) 2005, 2007 Slava Pestov.
|
! Copyright (C) 2005, 2008 Slava Pestov.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: arrays kernel sequences math math.functions hints
|
USING: arrays kernel sequences math math.functions hints
|
||||||
math.order ;
|
math.order ;
|
||||||
|
@ -19,8 +19,8 @@ IN: math.vectors
|
||||||
: vmax ( u v -- w ) [ max ] 2map ;
|
: vmax ( u v -- w ) [ max ] 2map ;
|
||||||
: vmin ( u v -- w ) [ min ] 2map ;
|
: vmin ( u v -- w ) [ min ] 2map ;
|
||||||
|
|
||||||
: v. ( u v -- x ) 0 [ * + ] 2reduce ;
|
: v. ( u v -- x ) [ * ] [ + ] 2map-reduce ;
|
||||||
: norm-sq ( v -- x ) 0 [ absq + ] reduce ;
|
: norm-sq ( v -- x ) [ absq ] [ + ] map-reduce ;
|
||||||
: norm ( v -- x ) norm-sq sqrt ;
|
: norm ( v -- x ) norm-sq sqrt ;
|
||||||
: normalize ( u -- v ) dup norm v/n ;
|
: normalize ( u -- v ) dup norm v/n ;
|
||||||
|
|
||||||
|
|
|
@ -4,12 +4,18 @@ USING: accessors kernel quotations help.syntax help.markup
|
||||||
io.sockets strings calendar ;
|
io.sockets strings calendar ;
|
||||||
IN: smtp
|
IN: smtp
|
||||||
|
|
||||||
|
HELP: smtp-domain
|
||||||
|
{ $description "The name of the machine that is sending the email. This variable will be filled in by the " { $link host-name } " word if not set by the user." } ;
|
||||||
|
|
||||||
HELP: smtp-server
|
HELP: smtp-server
|
||||||
{ $description "Holds an " { $link inet } " object with the address of an SMTP server." } ;
|
{ $description "Holds an " { $link inet } " object with the address of an SMTP server." } ;
|
||||||
|
|
||||||
HELP: smtp-read-timeout
|
HELP: smtp-read-timeout
|
||||||
{ $description "Holds an " { $link duration } " object that specifies how long to wait for a response from the SMTP server." } ;
|
{ $description "Holds an " { $link duration } " object that specifies how long to wait for a response from the SMTP server." } ;
|
||||||
|
|
||||||
|
HELP: esmtp?
|
||||||
|
{ $description "Set true by default, determines whether the SMTP client is using the Extended SMTP protocol." } ;
|
||||||
|
|
||||||
HELP: with-smtp-connection
|
HELP: with-smtp-connection
|
||||||
{ $values { "quot" quotation } }
|
{ $values { "quot" quotation } }
|
||||||
{ $description "Connects to an SMTP server stored in " { $link smtp-server } " and calls the quotation." } ;
|
{ $description "Connects to an SMTP server stored in " { $link smtp-server } " and calls the quotation." } ;
|
||||||
|
@ -36,5 +42,10 @@ HELP: send-email
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
ARTICLE: "smtp" "SMTP Client Library"
|
ARTICLE: "smtp" "SMTP Client Library"
|
||||||
|
"Configuring SMTP:"
|
||||||
|
{ $subsection smtp-server }
|
||||||
|
{ $subsection smtp-read-timeout }
|
||||||
|
{ $subsection smtp-domain }
|
||||||
|
{ $subsection esmtp? }
|
||||||
"Sending an email:"
|
"Sending an email:"
|
||||||
{ $subsection send-email } ;
|
{ $subsection send-email } ;
|
||||||
|
|
|
@ -10,7 +10,7 @@ IN: smtp
|
||||||
SYMBOL: smtp-domain
|
SYMBOL: smtp-domain
|
||||||
SYMBOL: smtp-server "localhost" "smtp" <inet> smtp-server set-global
|
SYMBOL: smtp-server "localhost" "smtp" <inet> smtp-server set-global
|
||||||
SYMBOL: smtp-read-timeout 1 minutes smtp-read-timeout set-global
|
SYMBOL: smtp-read-timeout 1 minutes smtp-read-timeout set-global
|
||||||
SYMBOL: esmtp t esmtp set-global
|
SYMBOL: esmtp? t esmtp? set-global
|
||||||
|
|
||||||
LOG: log-smtp-connection NOTICE ( addrspec -- )
|
LOG: log-smtp-connection NOTICE ( addrspec -- )
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@ TUPLE: email
|
||||||
: command ( string -- ) write crlf flush ;
|
: command ( string -- ) write crlf flush ;
|
||||||
|
|
||||||
: helo ( -- )
|
: helo ( -- )
|
||||||
esmtp get "EHLO " "HELO " ? host-name append command ;
|
esmtp? get "EHLO " "HELO " ? host-name append command ;
|
||||||
|
|
||||||
ERROR: bad-email-address email ;
|
ERROR: bad-email-address email ;
|
||||||
|
|
||||||
|
|
|
@ -747,6 +747,17 @@ PRIVATE>
|
||||||
: unclip-slice ( seq -- rest first )
|
: unclip-slice ( seq -- rest first )
|
||||||
[ rest-slice ] [ first ] bi ; inline
|
[ rest-slice ] [ first ] bi ; inline
|
||||||
|
|
||||||
|
: 2unclip-slice ( seq1 seq2 -- seq1' seq2' elt1 elt2 )
|
||||||
|
[ unclip-slice ] bi@ swapd ; inline
|
||||||
|
|
||||||
|
: map-reduce ( seq map-quot reduce-quot -- result )
|
||||||
|
[ [ unclip-slice ] dip [ call ] keep ] dip
|
||||||
|
compose reduce ; inline
|
||||||
|
|
||||||
|
: 2map-reduce ( seq1 seq2 map-quot reduce-quot -- result )
|
||||||
|
[ [ 2unclip-slice ] dip [ call ] keep ] dip
|
||||||
|
compose 2reduce ; inline
|
||||||
|
|
||||||
: unclip-last-slice ( seq -- butlast last )
|
: unclip-last-slice ( seq -- butlast last )
|
||||||
[ but-last-slice ] [ peek ] bi ; inline
|
[ but-last-slice ] [ peek ] bi ; inline
|
||||||
|
|
||||||
|
|
|
@ -10,9 +10,6 @@ IN: sequences.lib.tests
|
||||||
{ { 16 17 18 19 20 } } [ 1 2 3 4 { 6 7 8 9 10 } [ + + + + ] 4 map-withn ] unit-test
|
{ { 16 17 18 19 20 } } [ 1 2 3 4 { 6 7 8 9 10 } [ + + + + ] 4 map-withn ] unit-test
|
||||||
[ { 910 911 912 } ] [ 10 900 3 [ + + ] map-with2 ] unit-test
|
[ { 910 911 912 } ] [ 10 900 3 [ + + ] map-with2 ] unit-test
|
||||||
|
|
||||||
[ 4 ] [ { 1 2 } [ sq ] [ * ] map-reduce ] unit-test
|
|
||||||
[ 36 ] [ { 2 3 } [ sq ] [ * ] map-reduce ] unit-test
|
|
||||||
|
|
||||||
[ 10 ] [ { 1 2 3 4 } [ + ] reduce* ] unit-test
|
[ 10 ] [ { 1 2 3 4 } [ + ] reduce* ] unit-test
|
||||||
[ 24 ] [ { 1 2 3 4 } [ * ] reduce* ] unit-test
|
[ 24 ] [ { 1 2 3 4 } [ * ] reduce* ] unit-test
|
||||||
|
|
||||||
|
|
|
@ -31,9 +31,6 @@ IN: sequences.lib
|
||||||
|
|
||||||
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||||
|
|
||||||
: map-reduce ( seq map-quot reduce-quot -- result )
|
|
||||||
>r [ unclip ] dip [ call ] keep r> compose reduce ; inline
|
|
||||||
|
|
||||||
: reduce* ( seq quot -- result ) [ ] swap map-reduce ; inline
|
: reduce* ( seq quot -- result ) [ ] swap map-reduce ; inline
|
||||||
|
|
||||||
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||||
|
|
Loading…
Reference in New Issue