]> gitweb.factorcode.org Git - factor.git/commitdiff
Merge branch 'master' of git://factorcode.org/git/factor
authorDoug Coleman <doug.coleman@gmail.com>
Sat, 26 Feb 2011 17:44:50 +0000 (11:44 -0600)
committerDoug Coleman <doug.coleman@gmail.com>
Sat, 26 Feb 2011 17:44:50 +0000 (11:44 -0600)
basis/http/http.factor
basis/http/parsers/parsers-tests.factor
basis/http/parsers/parsers.factor
basis/math/polynomials/polynomials-tests.factor
basis/math/polynomials/polynomials.factor

index 46b67b53216e76f313a54745907eb212baa1117b..2030b0d825129cff79e346230ddf8b474abbd914 100644 (file)
@@ -108,7 +108,7 @@ TUPLE: cookie name value version comment path domain expires max-age http-only s
 
 : (unparse-cookie) ( cookie -- strings )
     [
-        dup name>> check-cookie-string >lower
+        dup name>> check-cookie-string
         over value>> check-cookie-value unparse-cookie-value
         "$path" over path>> unparse-cookie-value
         "$domain" over domain>> unparse-cookie-value
@@ -120,7 +120,7 @@ TUPLE: cookie name value version comment path domain expires max-age http-only s
 
 : unparse-set-cookie ( cookie -- string )
     [
-        dup name>> check-cookie-string >lower
+        dup name>> check-cookie-string
         over value>> check-cookie-value unparse-cookie-value
         "path" over path>> unparse-cookie-value
         "domain" over domain>> unparse-cookie-value
index f8c3b836a6e7d0eb4f7590ab81c22eddc49d1253..438f15a7a318609a1f47d45797c0542ce16f22ab 100644 (file)
@@ -11,6 +11,10 @@ IN: http.parsers.tests
 [ "__s=12345567" parse-cookie ]
 unit-test
 
+[ { T{ cookie { name "CaseSensitive" } { value "aBc" } } } ]
+[ "CaseSensitive=aBc" parse-cookie ]
+unit-test
+
 [ { T{ cookie { name "__s" } { value "12345567" } } } ]
 [ "__s=12345567;" parse-cookie ]
 unit-test
index 1a8023681744b17df010579ede78d55187774b18..9c81510925bd5ca31508052222f27255edf04600 100644 (file)
@@ -135,7 +135,7 @@ PEG: parse-header-line ( string -- pair )
     2choice case-sensitive ;
 
 : 'attr' ( -- parser )
-    'token' case-insensitive ;
+    'token' case-sensitive ;
 
 : 'av-pair' ( -- parser )
     [
index 22ac89bc7d3b23c5cf13dadd12bd8b7c667cced8..43217b452c49b807b8c1ae34c9b32b2a4776b280 100644 (file)
@@ -33,3 +33,9 @@ IN: math.polynomials.tests
 
 [ { 10 200 3000 } ] [ { 1 10 100 1000 } pdiff ] unit-test
 
+
+[ { -512 2304 -4608 5376 -4032 2016 -672 144 -18 1 } ]
+[ { -2 1 } 9 p^ ] unit-test
+
+[ 0 ]
+[ 2 { -2 1 } 9 p^ polyval ] unit-test
index 241fd34be99c227ea749508ec9cf66f15733c2bd..7e43ec94ba331aa85f1aa351801464884935f912 100644 (file)
@@ -91,7 +91,10 @@ PRIVATE>
     dup length iota v* rest ;
 
 : polyval ( x p -- p[x] )
-    [ length swap powers ] [ nip ] 2bi v. ;
+    ! Horner scheme
+    [ nip <reversed> unclip-slice swap ]
+    [ drop ] 2bi
+    '[ [ _ * ] dip + ] each ;
 
 MACRO: polyval* ( p -- )
     reverse