Search found 604 matches
- Sat Jan 05, 2013 10:57 pm
- Forum: newLISP newS
- Topic: libevent2
- Replies: 6
- Views: 8744
Re: libevent2
Here is an example of how a simple echo server might look: (load "libevent2.lsp") (setf listen (net-listen 8000)) (unless listen (throw-error (net-error))) (libevent:init) (libevent:watch listen libevent:READ (lambda (fd e id , client) ; accept a new connection (setf client (net-accept listen)) ; wa...
- Sat Jan 05, 2013 10:02 pm
- Forum: newLISP newS
- Topic: libevent2
- Replies: 6
- Views: 8744
Re: libevent2
Actually, that is not exactly true. That is more how signals work, although not in libevent. In libevent, the application is controlled by the loop. Before starting the loop, you register at least one socket or timer to run in it. It is an error to run a loop with no events registered. For example, ...
- Fri Jan 04, 2013 8:01 pm
- Forum: newLISP newS
- Topic: libevent2
- Replies: 6
- Views: 8744
libevent2
Howdy folks. Haven't been around in a while. Wanted to let you know that I put together a wrapper for libevent2 using the new FFI features. Made it very easy. You can find it on github here - https://github.com/jsober/nl-event.
- Tue Dec 15, 2009 11:51 am
- Forum: newLISP newS
- Topic: libmemcached api
- Replies: 6
- Views: 4926
Re: libmemcached api
Without checking the code again, it looks like you are doing things right. Unfortunately, I do not have a lot of time for personal projects at the moment. If you can find the bug and fix it, I would be happy to update the sources on my site and google projects.
- Tue Oct 13, 2009 2:43 pm
- Forum: newLISP in the real world
- Topic: Mapping with two arguments
- Replies: 7
- Views: 2814
- Tue Oct 13, 2009 2:41 pm
- Forum: newLISP in the real world
- Topic: Mapping with two arguments
- Replies: 7
- Views: 2814
- Tue Oct 13, 2009 2:30 pm
- Forum: Whither newLISP?
- Topic: Few questions ...
- Replies: 24
- Views: 13231
- Tue Oct 13, 2009 2:21 pm
- Forum: newLISP in the real world
- Topic: Mapping with two arguments
- Replies: 7
- Views: 2814
You need to pass map a function. You can do that with curry:
Code: Select all
(map (curry add-tail (dup "-Schwanz" 3 true)) '("Hund" "Katze" "Pinguin"))
- Tue Oct 13, 2009 1:39 pm
- Forum: Whither newLISP?
- Topic: Few questions ...
- Replies: 24
- Views: 13231
Thank you, Lutz. This is exactly the hook we need to extend the language. This is a good thing for the language. Will reader-event be hooked into run-time compilation as well? That is, when I call read-expr, will the expression be first run through reader-event? I believe it should, so that translat...
- Tue Oct 13, 2009 12:25 pm
- Forum: Whither newLISP?
- Topic: Few questions ...
- Replies: 24
- Views: 13231
Lutz, one other thing. Shouldn't this be reader-event, not read-event?
Neither is documented in the manual.
Code: Select all
(define (resume)
(read-event rewrite))
- Tue Oct 13, 2009 12:11 pm
- Forum: Whither newLISP?
- Topic: Few questions ...
- Replies: 24
- Views: 13231
That's not what I meant. I meant that it would be nice to have the type of compile-time expansion you built using read-expr but in the context of a non-defining expression. More like letex than define, in other words. That way we could use them as part of a regular newlisp macro. Like the backtick i...
- Tue Oct 13, 2009 1:08 am
- Forum: Whither newLISP?
- Topic: Few questions ...
- Replies: 24
- Views: 13231
- Mon Oct 12, 2009 7:17 pm
- Forum: Whither newLISP?
- Topic: Evaluating Clojure
- Replies: 10
- Views: 5850
- Mon Oct 12, 2009 6:00 pm
- Forum: Whither newLISP?
- Topic: Few questions ...
- Replies: 24
- Views: 13231
This nice thing about these macros is that you are actually performing a compile-time transformation on the code. You can use them to easily define destructive setters on OOP classes, for example, because they would translate into the actual code that returns a reference. Perhaps something like this...
- Mon Oct 12, 2009 2:18 pm
- Forum: Whither newLISP?
- Topic: Asynchronous I/O with libevent
- Replies: 1
- Views: 2523
Asynchronous I/O with libevent
Hey folks, I am in the process of polishing up the interface to a wrapper module around libevent, an asynchronous I/O library for Windows, Linux, Unix, and OSX. What is asynchronous I/O? Threading and multiprocessing are expensive ways to take advantage of multi-core systems. They add complexity to ...
- Fri Oct 09, 2009 3:27 pm
- Forum: Whither newLISP?
- Topic: GeSHi plugin
- Replies: 6
- Views: 4520
- Wed Oct 07, 2009 10:14 pm
- Forum: newLISP in the real world
- Topic: How to take one byte from a string
- Replies: 11
- Views: 3378
- Wed Oct 07, 2009 1:37 pm
- Forum: Whither newLISP?
- Topic: Contexts and macros
- Replies: 1
- Views: 2360
Contexts and macros
If the preferred method to avoid variable capture is to use lexically scoped macros, why not make all macros lexically scoped by default? Why not have the reader implicitly read local variables in a macro as if the macro were written: (context 'my-macro) (define-macro (my-macro ...) ...) (context 'p...
- Tue Oct 06, 2009 7:39 pm
- Forum: newLISP in the real world
- Topic: net-receive and wait-string
- Replies: 2
- Views: 1336
- Tue Oct 06, 2009 7:05 pm
- Forum: newLISP in the real world
- Topic: net-receive and wait-string
- Replies: 2
- Views: 1336
net-receive and wait-string
Does net-receive block while waiting on wait-string if:
1) it is not found before int-max-bytes are read
2) it is not found in the bytes immediately available from the remote socket
If it does block for situation 2, is there any way to evade that behavior while still using the built-in buffer?
1) it is not found before int-max-bytes are read
2) it is not found in the bytes immediately available from the remote socket
If it does block for situation 2, is there any way to evade that behavior while still using the built-in buffer?
- Mon Oct 05, 2009 5:52 pm
- Forum: Whither newLISP?
- Topic: newLISP compiler
- Replies: 9
- Views: 6455
I think an extension api with the following components would let us do whatever is necessary: 1) an include with the major types - nil, cell, symbol, etc 2) a shared library would have an "init" function that calls a macro or function that registers a function with newlisp; it would also have a "clo...
- Mon Oct 05, 2009 1:41 pm
- Forum: newLISP in the real world
- Topic: Timing question
- Replies: 11
- Views: 3267
Code: Select all
(define (triple n)
(expand (* 3 n) n))
- Mon Oct 05, 2009 12:58 pm
- Forum: Whither newLISP?
- Topic: newLISP compiler
- Replies: 9
- Views: 6455
It would be nice to have a more robust API to extend newlisp from C, though. The "extend rather than embed" philosophy of Python is equally applicable to newlisp. I write a lot of C libraries and end up spending a lot of time gluing the code together with newlisp. A few glue functions in a shared li...
- Mon Oct 05, 2009 12:55 pm
- Forum: newLISP in the real world
- Topic: Timing question
- Replies: 11
- Views: 3267
- Fri Oct 02, 2009 12:05 pm
- Forum: newLISP in the real world
- Topic: Searching in nested list
- Replies: 3
- Views: 1589
Here is a tutorial on drilling down into xml content in newlisp:
http://www.artfulcode.net/articles/working-xml-newlisp/
Here is a tutorial on using find-all with xml (among others) in newlisp:
http://www.artfulcode.net/articles/usin ... -find-all/
http://www.artfulcode.net/articles/working-xml-newlisp/
Here is a tutorial on using find-all with xml (among others) in newlisp:
http://www.artfulcode.net/articles/usin ... -find-all/