Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - itistoday

#46
newLISP in the real world / Re: event system
January 29, 2011, 07:01:14 PM
Cool, I like it! :-)



Don't know if you'll find this useful, but your code reminded me of a somewhat similar macro I made called 'wrap-func':


(define-macro (wrap-func func-sym wrapper , wrapped-func)
(setf wrapped-func (sym (string func-sym "|wrapped#" (inc wrap-func.counter))))
(set wrapped-func (eval func-sym))
(set func-sym (eval (expand wrapper 'wrapped-func)))
)


An example usage:


(wrap-func db:execute-update (fn ()
(unless (apply wrapped-func $args)
(error-out "execute-update failed: " $args)
)
))


Now when db:execute-update gets called, the function above is called instead, which then calls the real execute-update function (via 'wrapped-func') and outputs an error message if it fails.



Edit: It's available as part of http://www.rundragonfly.com/">Dragonfly actually.
#47
Dragonfly / Re: The Dragonfly showcase
December 29, 2010, 01:05:54 PM
Dragonfly powers the backend for the https://www.taoeffect.com/espionage/order/">Tao Effect webstore & integration with PayPal.
#48
Hey Jeremy, unfortunately my plate is ridiculously full at the moment, so I can't look into this—off the top of my head I'd suggest trying with Apache and see if it works there (if you're using newlisp's built-in server for this). If that doesn't help and you're able to figure out why, I'd be happy to apply any patches.
#49
Whither newLISP? / Re: anonymous rb-trees?
October 24, 2010, 11:27:10 PM
Quote from: "TedWalther"Thanks itistoday.  Are these objects garbage collected with ORO?


They must be manually managed via reference counting (like in objective-c), see the link for details.
#50
Whither newLISP? / Re: anonymous rb-trees?
October 24, 2010, 06:45:07 PM
I've posted various techniques for creating pseudo-anonymous objects in newLISP (i.e. see my sig). You can do the same with rb-trees. Just create a function that creates contexts with a prefix + incrementing number (i.e. like 'gensym').
#51
Quote from: "joejoe"Am I correct to read that Im getting a permission denied trying to access gcc? Any workarounds on this?


Yup, you'll have to contact whoever admins the server about this.
#52
newLISP and the O.S. / Re: Benchmarking newLISP
September 23, 2010, 11:48:32 AM
Nice, 64-bit is definitely a little bit faster:


$ ./newlisp qa-specific-tests/qa-bench

Benchmarking all non I/O primitives
    1016.4 ms
>>>>> Performance ratio: 0.45 (1.0 on Mac OS X, 1.83 GHz Intel Core 2 Duo)


2.4GHz Intel Core i5 MacBook Pro here. :-)
#53
Anything else we might add? / Re: new to newLISP
August 31, 2010, 10:31:06 PM
Welcome Ormente!



If you haven't seen it already, you might be interested in the http://www.rundragonfly.com">newLISP Dragonfly Web Framework.
#54
That's odd, I don't have time unfortunately to test this out immediately (in the middle of a move), but try removing the size attribute perhaps?



Also, try running it through Apache and not newlisp's server. If that doesn't work let me know (or better yet, file an issue on the http://github.com/taoeffect/dragonfly-newlisp">github project page).
#55
Sorry, I just skimmed over this thread and saw Dragonfly mentioned. Just want to mention that Dragonfly should take care of all the uploading stuff for you, you don't need to write your own. See the documentation for the $FILES:



http://www.rundragonfly.com/dragonfly_api">http://www.rundragonfly.com/dragonfly_api



$FILES is for multipart-form data.



There's also a different method of uploading data, which is basically a POST to the URL with binary data, in which case use $BINARY.
#56
newLISP newS / TextMate bundle for newLISP
July 08, 2010, 01:53:10 PM
I've added my TextMate bundle for newLISP to github:



http://github.com/taoeffect/newLISP.tmbundle">http://github.com/taoeffect/newLISP.tmbundle
#57
Whither newLISP? / Re: Nesting and Booleans
July 06, 2010, 12:55:47 PM
I haven't played with it much and I'm not sure it's a very efficient solution, but you might want to take a look at the 'reader-event' function, which may allow you to implement the | syntax.
#58
Whither newLISP? / Re: Nesting and Booleans
July 04, 2010, 06:43:36 PM
I should elaborate that beyond being non-idiomatic, it would make it difficult to tell whether the code you're seeing is function composition, or a call to a function that's accepting several arguments, which is why it's probably better to be explicit.
#59
Whither newLISP? / Re: Nesting and Booleans
July 04, 2010, 06:14:24 PM
I can't find the original thread where define-smacro was discussed....



Only thing I've been able to find that discusses the hygenic macro issue is here:



http://newlispfanclub.ryon.webfactional.com/forum/viewtopic.php?f=5&t=1080">http://newlispfanclub.ryon.webfactional ... f=5&t=1080">http://newlispfanclub.ryon.webfactional.com/forum/viewtopic.php?f=5&t=1080
#60
Whither newLISP? / Re: Nesting and Booleans
July 04, 2010, 06:06:48 PM
I think it's cool, but I'm not sure this would result in very clear code (for others reading it). People coming to newLISP from other Lisps would be baffled by this. Does the advantage of not having to write an 'if' make it worth it? I'm not sure...



BTW, Clojure has a builtin function called 'comp' (for composition) that is essentially your 'nest' macro. I think explicitly calling nest/comp is the better way of doing it, as that's more "idiomatic".



Some bugs I noticed: new-integer? and bool-if should be macros so that they don't evaluate their arguments (and you might want to use define-smacro, see below), there are missing calls to parameters in the sn/cs functions, and your nest macro is polluting its calling context by not using 'let' to set 'op', rargs, r, and lst.


(define-macro (define-smacro)
    (let (_temp1 (append (fn-macro) (cons (1 (args 0)) (rest $args))) _temp2 (args 0 0))
        (def-new '_temp1 (sym _temp2 _temp2))
)
)