freenode/#lisp - IRC Chatlog
Search
13:32:13
didi
(ppcre:split "\\W+" " foo") => ("" "foo") but I want ("foo"), i.e. I want to split a string into words.
13:33:47
didi
I thought trailing empty strings were eliminated. "If limit is NIL (or 0 which is equivalent), trailing empty strings are removed from the result list."
13:34:41
splittist
mtl_: do you have an idea of what the api to tui might look like? I'm doing something with curses at the moment but want to be able to support other (text/terminal-based) approaches.
13:35:31
splittist
(Of course, this is all displacement activity from actually adding functionality...)
13:53:38
didi
I am doing (remove "" (ppcre:split "\\W+" " foo") :test 'string=) but this doesn't feel right.
14:12:19
jdz
didi: you know you can write your own function if ppcre:split does not do what you want?
14:15:35
jdz
and ppcre:split has this note: "This function also tries hard to be Perl-compatible - thus the somewhat peculiar behaviour."
14:19:57
dlowe
Sorry, I mean it's easier to ask the regex engine for what you want i.e. characters matching words
14:46:57
mtl_
splittist: not currently, no, although I've been having a peek at urwid(http://urwid.org/) as a possible inspiration
14:50:42
splittist
mtl_: OK. A bit higher level than I was thinking of - I think I want to manage my own event loops.
14:51:20
mtl_
splittist: early day still, I'm just trying to look at what something that isn't ncurses is doing, right now
14:52:55
splittist
mtl_: it does look fascinating, though. I can certainly see uses I could put it to for things in my dream-queue of projects (:
15:01:26
mtl_
briefly looking at croatoan, it seems more complete than cl-charms already, in terms of higher level wrappers
15:01:27
warweasle
I'm reading Patrick Stein's article about Clean Architecture and I'm curious, how does this differ from the ideas in the book "Thinking Forth"?
15:27:59
Shinmera
Does anyone have a recommended library for encoding objects to send over the network? I've looked at cl-conspack, but unfortunately it's unsuitable for my use case since it only allows adding en/decoding functions for specific clos classes. I need to be able to write a generic method that covers many subclasses 'automagically'.
15:31:38
dlowe
yeah, but they're pretty flexible, and a schema isn't always a bad thing for network communication
15:43:15
Shinmera
Hm. Anyone know anything about cl-serializer? The uh "new page" is less than helpful http://dwim.hu/project/hu.dwim.serializer?_x=SxfY&_f=RZZzXQAn http://www.cliki.net/cl-serializer
15:51:48
Baggers
with slime/swank, is it possible to set which thread is the repl thread? due to osx reasons I'd like to be able to run expressions types in the repl, on 'thread 0'
15:53:02
Baggers
i've been using communication :style nil, but #'start-swank-server-in-thread seems more promising
16:07:55
dlowe
kamenn: you'll need to use some posix interface library, either the one that came with your implementation or one like iolib
16:47:03
Shinmera
jasom: Yeah, I'm looking at it now. Seems the best shot out of all the ones listed on the wiki.
16:47:27
Shinmera
It does, but it's erroring on my objects. Probably due to some MOP stuff messing things up on my end.
16:48:24
Shinmera
I have some stuff in place to have immutable slots, I'm guessing it's springing that trap.
16:50:31
jasom
Shinmera: you can also specialize conspack:encode-object ((object standard-object) &key &allow-other-keys)
16:51:31
DeadTrickster
like if class has initforms code called twice - first initform and then slot-values set
16:51:45
jasom
DeadTrickster: since you use it, out of curiousity, have you implemented redlock in cl-redus? I'm working on an implementation right now but would be happy to not duplicate that effort
16:54:30
jasom
yeah, redis is a great key-value store, but people who try to use it for more than that can run into problems
16:56:19
DeadTrickster
absolutely! with redis we just tasted messages passing and it was ok but hell amqp and rabbitmq give just much more
16:57:53
jasom
DeadTrickster: just atomic modification of compound values; I could get around most needs for it by storing each subvalue under its own key, but redlock for r-m-w is a lot easier
16:59:03
jasom
and the common case for my workload is no contention, and the overhead is very low for redlock in that case
17:00:35
DeadTrickster
It is well known fact - problems other people solve sound much more interesting than mine :-)
19:02:55
f-a
I am reading a bit on anaphoric macros like these http://paste.lisp.org/display/306610 I was wondering: for the first example, wouldn't a named let do?
19:03:47
f-a
I guess every macro can be seen as "a shorter way of accomplishing x", but I was wonderin if there was any other reason to use aif/alambda
19:12:37
Bike
the second would be (let ((it (big-long-calculation))) (if it (foo it))). which is probably what aif expands to, more or less.
19:15:02
ecraven
also, anaphoric macros could communicate "behind your back" without you (having to) notice :)
19:16:45
pjb
phoe_krk: there's no need for a definition of unquote, in the reader. The reader only reads. You can quote a backquote expression to read it without evaluating '`(a ,b ,@d e) or use READ. Notice that I could not conformingly provide anything else, since what is read by the implementations #\` reader macro is implementation specific.
19:16:56
Bike
oh, and the first one would be (labels ((self (n) (if (> n 0) (cons n (self (- n 1))))) #'self).
19:17:37
pjb
phoe_krk: basically, in general you will have to define your own reader macros, just like if you used the implementation reader for your own purposes.
19:22:24
pjb`
drmeister: the usual idiom is (when (next-method-p) (call-next-method)) ; a bare (call-next-method) would be risky, given that the class graph and therefore the applicable method list can change dynamically.
19:22:31
pjb`
phoe_krk: there's no need for a definition of unquote, in the reader. The reader only reads. You can quote a backquote expression to read it without evaluating '`(a ,b ,@d e) or use READ. Notice that I could not conformingly provide anything else, since what is read by the implementations #\` reader macro is implementation specific.
19:23:17
pjb
phoe_krk: basically, in general you will have to define your own reader macros, just like if you used the implementation reader for your own purposes.
19:33:39
pjb
pillton: there's make-package, but you would argue that it's only partial. One problem in your question is that the exact semantics of defpackage are implementation dependant. One conforming implementation that is not implementation dependant is com.informatimago.common-lisp.lisp-reader.package:defpackage which expands to a call to the function com.informatimago.common-lisp.lisp-reader.package::%define-package ; this would be the
19:35:23
pjb
minion: memo for arnaudga: have a look at cl-stepper (com.informatimago.common-lisp.lisp.stepper).
19:36:20
pjb
pillton: stepping in CL is not that complicated. You just have to try to do it three times to get about right ;-)
19:36:53
PuercoPop
phoe_krk: but if you need quasiquote to be defined in the reader there is fare-quasiquote
20:40:57
jasom
warweasle: it uses the C compiler to extract information about structure layouts and #define constants. If you think about it, it's trivial to write a C program to extract the information, so the groveller generates a C program that does so and then runs it.
21:26:23
dptd
I have a simple (I guess) but really important question (I am new to Lisp as you can already observe).
21:27:59
dptd
I want to use for example function "foo" - writen by someone, or available in some library but... och, I see.
21:28:25
p_l
dptd: when it comes to source code, SLIME has the great M-. (alt/meta + dot) shortcut which tries to take you to location of the definition
21:28:35
dlowe
if the function is already loaded and you're using a nice development environment, you can easily get help on a function
21:29:17
dptd
For C++ we have for example cppreference.com where I can find pretty much everything from the standard library. For Lisp there is a hyperspec but it's pretty difficult to search for anything there.
21:29:40
dptd
Yeah, I am running Slime. Actually this is my second (yesterday was first) time connecting with IRC from emacs. Pretty awesome.