Greg Slepak avatar Greg Slepak committed 177217a

fixed define-smacro and added null->nil to database_utils

Comments (0)

Files changed (3)

 Version 0.7
 
   * all code uses new ++,--,extend,write,read functions (still compatible with older newlisps)
-  * now $BINARY can handle large data (compensated for a newLISP bug in 'read-buffer').
+  * added 'extract' and '<-' functions to core utils
   * added documentation for MAX_POST_LENGTH in request.lsp
-  * fix to Jeff's JSON.lsp plugin (switched to " instead of ' for strings)
+  * $BINARY can now handle large data (compensated for a newLISP bug in 'read-buffer').
   * DF:activate-plugin can now be used to load all lisp files in a directory
-  * db/database_utils includes for-query-with-db, fn-query-with-db, assoc-row-with-db, assoc-rows-with-db and query-cell-with-db
+  * db/database_utils includes for-query-with-db, assoc-row-with-db, query-cell-with-db and others
   * db/database_orm - DB.OBJ - a very simple ORM for DF.DB
+  * fixed Jeff's JSON.lsp plugin (switched to " instead of ' for strings)
   * fixed handling of floats in Sqlite3 on some architectures (more improvements needed though, see TODO)
-  * added 'extract' and '<-' functions to core utils
+  * fixed bug in definition of define-smacro
 
 Version 0.6
 

example-site/dragonfly-framework/lib/utils.lsp

 ;; that it does this by placing the macro in its own context, so be careful
 ;; when choosing its name!</p>
 	(define-macro (define-smacro)
-	    (let (temp (append (fn-macro) (list (1 (args 0)) (args 1))))
-	        (def-new 'temp (sym (args 0 0) (args 0 0)))
+	    (let (_temp1 (append (fn-macro) (cons (1 (args 0)) (rest $args))) _temp2 (args 0 0))
+	        (def-new '_temp1 (sym _temp2 _temp2))
 		)
 	)
 	

example-site/dragonfly-framework/plugins-inactive/db/database_utils.lsp

 
 (context MAIN)
 
+(define (null->nil x)
+	(if-not (null? x) x)
+)
+
 ; define-smacro defined in utils.lsp (part of Dragonfly's core functions)
 (define-smacro (for-query-with-db db query)
 	(letn (ctx (prefix db) db (eval db) sql (db:prepare-sql (eval query)) keys '() values)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.