Overview
Comment:Yikes. Changes sitting around on disk for long time.... s:any->pgint fix?
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 7807ffe39b7026b46baa5043af6349af3e52b4b5
User & Date: matt on 2011-09-24 22:13:37
Other Links: manifest | tags
Context
2011-09-25
03:33
Cleaned up twiki, no more table based layout. Also no documentation yet... check-in: 3217617d70 user: matt tags: trunk
2011-09-24
22:13
Yikes. Changes sitting around on disk for long time.... s:any->pgint fix? check-in: 7807ffe39b user: matt tags: trunk
2011-06-09
05:09
Added string to pgint check-in: be70f56b97 user: matt tags: trunk
Changes

Modified doc/howto.txt from [21264108f0] to [f196be1330].

93
94
95
96
97
98
99




100
101
102
103
104
105
106
  i. Lazy/safe string->number 

(s:any->number val)

  ii. Random string

(session:make-rand-string len)





======================================================================
9. Forms and input

(s:form 'action "login.login" 'method "post"
   (s:input-preserve 'type "text" 'name "email-address" 'size "16" 'maxlength "30")
   (s:input 'type "submit"   'name "form-name" 'value "login"))







>
>
>
>







93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
  i. Lazy/safe string->number 

(s:any->number val)

  ii. Random string

(session:make-rand-string len)

 iii. string to number for pgint
 
(s:any->pgint val)

======================================================================
9. Forms and input

(s:form 'action "login.login" 'method "post"
   (s:input-preserve 'type "text" 'name "email-address" 'size "16" 'maxlength "30")
   (s:input 'type "submit"   'name "form-name" 'value "login"))

Modified doc/stml-manual.odt from [946d97e5d9] to [55a66e4646].

cannot compute difference between binary files

Modified misc-stml.scm from [7db3e6d38a] to [97e4132f22].

197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212

213
214
215
216
217
218
219
220
   ((string? val)  (string->number val))
   ((symbol? val)  (string->number (symbol->string val)))
   (else     #f)))

;; NB// this is *illegal* pgint
(define (s:illegal-pgint val)
  (cond
   ((> n 2147483647) 1)
   ((< n -2147483648) -1)
   (else #f)))

(define (s:any->pgint val)
  (let ((n (s:any->number val)))
    (if n
	(if (s:illegal-pgint val)
	    #f

	    n))))

;; string is a string and non-zero length
(define (misc:non-zero-string str)
  (if (and (string? str)
           (> (string-length str) 0))
      str
      #f))







|
|





|

>
|







197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
   ((string? val)  (string->number val))
   ((symbol? val)  (string->number (symbol->string val)))
   (else     #f)))

;; NB// this is *illegal* pgint
(define (s:illegal-pgint val)
  (cond
   ((> val 2147483647) 1)
   ((< val -2147483648) -1)
   (else #f)))

(define (s:any->pgint val)
  (let ((n (s:any->number val)))
    (if n
	(if (s:illegal-pgint n)
	    #f
	    n)
	n)))

;; string is a string and non-zero length
(define (misc:non-zero-string str)
  (if (and (string? str)
           (> (string-length str) 0))
      str
      #f))

Modified tests/test.scm from [4d4eb9d318] to [855998c61d].

119
120
121
122
123
124
125





126
127
128
129
130
131
132
(test "make <formdat>" #t (let ((f (make <formdat>)))
			    (set! form f)
			    #t))
(test "formdat: set!/get" "Yep!" (begin
				   (formdat:set! form "blah" "Yep!")
				   (formdat:get  form "blah")))






;; The twiki module

;; clean up
(system "rm -rf twikis/*")
(load "modules/twiki/twiki-mod.scm")
(define keys (list "blah" 1 'nada))
(test "twiki:keys->key"  "blah 1 nada" (twiki:keys->key keys))







>
>
>
>
>







119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
(test "make <formdat>" #t (let ((f (make <formdat>)))
			    (set! form f)
			    #t))
(test "formdat: set!/get" "Yep!" (begin
				   (formdat:set! form "blah" "Yep!")
				   (formdat:get  form "blah")))

(test "s:string->pgint"   123 (s:any->pgint "123"))
(test "s:illegal-pgint (legal)"        #f (s:illegal-pgint 1011))
(test "s:illegal-pgint (illegal big)"   1 (s:illegal-pgint  9999999999))
(test "s:illegalpgint (illegal small)" -1 (s:illegal-pgint -9999999999))

;; The twiki module

;; clean up
(system "rm -rf twikis/*")
(load "modules/twiki/twiki-mod.scm")
(define keys (list "blah" 1 'nada))
(test "twiki:keys->key"  "blah 1 nada" (twiki:keys->key keys))