<pjb>
(defun combinations (list n) (cond ((zerop n) '()) ((= 1 n) (mapcar (function list) list)) (t (mapcan (lambda (rest) (mapcan (lambda (first) (list (cons first rest))) list)) (combinations list (1- n)))))) (combinations '(a b c) 3) #| --> ((a a a) (b a a) (c a a) (a b a) (b b a) (c b a) (a c a) (b c a) (c c a) (a a b) (b a b) (c a b) (a b b) (b b b) (c b b) (a c b) (b c b) (c c b) (a a c) (b a c) (c a c) (a b c) (b b c) (c b c) (a
Elronnd has quit [Remote host closed the connection]
smasta has quit [Ping timeout: 245 seconds]
smasta has joined #lisp
smasta has quit [Ping timeout: 246 seconds]
__jrjsmrtn__ has joined #lisp
karlosz has quit [Quit: karlosz]
ricekrispie has quit [Read error: Connection reset by peer]
fivo has joined #lisp
milanj has joined #lisp
akoana has left #lisp ["Leaving"]
smasta has joined #lisp
lonjil2 has quit [Ping timeout: 258 seconds]
smasta has quit [Ping timeout: 250 seconds]
lonjil has joined #lisp
pjb has quit [Ping timeout: 252 seconds]
pjb has joined #lisp
fanta7531 has joined #lisp
ricekrispie has joined #lisp
atgreen has quit [Ping timeout: 240 seconds]
smasta has joined #lisp
rumbler31 has quit [Remote host closed the connection]
atgreen has joined #lisp
Lycurgus has quit [Ping timeout: 245 seconds]
smasta has quit [Ping timeout: 250 seconds]
edgar-rft has quit [Quit: Leaving]
caltelt_ has quit [Ping timeout: 250 seconds]
esrse has quit [Ping timeout: 250 seconds]
akater has joined #lisp
__jrjsmrtn__ has quit [Ping timeout: 255 seconds]
__jrjsmrtn__ has joined #lisp
Essadon has joined #lisp
nwoob has joined #lisp
libertyprime has quit [Read error: Connection reset by peer]
libertyprime has joined #lisp
smasta has joined #lisp
smasta has quit [Ping timeout: 246 seconds]
nwoob has quit [Ping timeout: 264 seconds]
hhdave has joined #lisp
themsay has joined #lisp
wigust- has quit [Read error: Connection reset by peer]
themsay has quit [Read error: Connection reset by peer]
wigust has joined #lisp
themsay has joined #lisp
smasta has joined #lisp
smasta has quit [Ping timeout: 244 seconds]
milanj has quit [Quit: This computer has gone to sleep]
grewal has joined #lisp
igemnace has quit [Quit: WeeChat 2.4]
milanj has joined #lisp
dddddd has joined #lisp
nwoob has joined #lisp
gjvc has joined #lisp
themsay has quit [Quit: Quit]
amerlyq has joined #lisp
Lycurgus has joined #lisp
ggole has joined #lisp
libertyprime has quit [Ping timeout: 246 seconds]
smasta has joined #lisp
xkapastel has joined #lisp
smasta has quit [Ping timeout: 246 seconds]
nwoob has quit [Ping timeout: 250 seconds]
libertyprime has joined #lisp
atgreen has quit [Ping timeout: 250 seconds]
orivej has quit [Ping timeout: 268 seconds]
smasta has joined #lisp
Bike has joined #lisp
smasta has quit [Ping timeout: 268 seconds]
LiamH has joined #lisp
Lord_of_Life_ has joined #lisp
Lord_of_Life has quit [Ping timeout: 255 seconds]
Lord_of_Life_ is now known as Lord_of_Life
AdmiralBumbleBee has quit [Ping timeout: 255 seconds]
nirved is now known as Guest93169
Guest93169 has quit [Killed (niven.freenode.net (Nickname regained by services))]
atgreen has joined #lisp
nirved has joined #lisp
AdmiralBumbleBee has joined #lisp
libertyprime has quit [Quit: leaving]
ebrasca has quit [Remote host closed the connection]
fanta7531 has quit [Quit: fanta7531]
nwoob has joined #lisp
patlv has joined #lisp
warweasle has joined #lisp
q9929t has joined #lisp
q9929t has quit [Quit: q9929t]
nwoob has quit [Ping timeout: 268 seconds]
dale_ has joined #lisp
dale_ is now known as dale
FreeBirdLjj has joined #lisp
FreeBirdLjj has quit [Ping timeout: 252 seconds]
nowhereman has joined #lisp
jayemar has joined #lisp
pjb has quit [Remote host closed the connection]
heisig has quit [Quit: Leaving]
powerbit has quit [Remote host closed the connection]
sjl_ has joined #lisp
sjl_ has quit [Client Quit]
sjl_ has joined #lisp
scymtym has quit [Ping timeout: 258 seconds]
varjag has quit [Quit: ERC (IRC client for Emacs 25.2.2)]
rumbler31 has joined #lisp
nowhereman has quit [Ping timeout: 246 seconds]
rumbler31 has quit [Ping timeout: 255 seconds]
aeth has quit [Ping timeout: 246 seconds]
pjb has joined #lisp
orivej has joined #lisp
aeth has joined #lisp
heisig has joined #lisp
igemnace has joined #lisp
rumbler31 has joined #lisp
rippa has joined #lisp
eddof13 has joined #lisp
eddof13 has quit [Client Quit]
jprajzne has quit [Quit: Leaving.]
eddof13 has joined #lisp
shifty has quit [Ping timeout: 245 seconds]
lumm has joined #lisp
heisig has quit [Remote host closed the connection]
Lycurgus has quit [Quit: Exeunt]
mindCrime has joined #lisp
shka_ has joined #lisp
Achylles has joined #lisp
edgar-rft has joined #lisp
ogamita has joined #lisp
gxt has joined #lisp
__jrjsmrtn__ has quit [Read error: Connection reset by peer]
hiroaki has quit [Ping timeout: 250 seconds]
ggole has quit [Quit: Leaving]
Inline has joined #lisp
hhdave has quit [Ping timeout: 250 seconds]
fivo has quit [Quit: WeeChat 1.9.1]
ebrasca has joined #lisp
gareppa has joined #lisp
gxt has quit [Quit: WeeChat 2.4]
karlosz has joined #lisp
karlosz has quit [Client Quit]
makomo has quit [Quit: WeeChat 2.2]
ricekrispie has quit [Quit: 0111001101101000011001010110010101100101011001010110100101110100]
samlamamma has joined #lisp
<samlamamma>
You know, Lisp is really the ultimate CRUD-application builder. Just provide the definition of your data and Lisp can generate all the code to transfer it between your app, the database, the protobuf layer, what have you.
lucasb has joined #lisp
<shka_>
well, you can generate bullshit code, that's true
<shka_>
good evening
<samlamamma>
shka_: Yes, and I'm sitting here writing bullshit code instead.
gareppa has quit [Quit: Leaving]
milanj has quit [Quit: This computer has gone to sleep]
<beach>
Yes, I am lucky that I can choose what to work on.
Achylles has quit [Ping timeout: 250 seconds]
samlamamma has quit [Ping timeout: 246 seconds]
<jackdaniel>
crud(l) is also aften used in api context (i.e RESTful API)
t58 has joined #lisp
<beach>
REST is another one that I only learned about not too long ago.
Jesin has quit [Quit: Leaving]
warweasle has quit [Quit: meeting]
<beach>
Databases seem to imply copying, and copying is contrary to the semantics of Common Lisp, so I am trying to figure out ways of managing data without copying it.
<beach>
... like universal persistence for instance.
nanoz has joined #lisp
smasta has joined #lisp
<shka_>
beach: yeah, you see this is stuff used to build every single webapp, and since it is used to build every single webapp efforts has been made to make it painless even though it still sucks
<shka_>
… i just realized that it sounds like unix
<beach>
Heh, yes.
<shka_>
anyway, my point is that most people don't care
<shka_>
*most people doesn't care
<beach>
don't
<beach>
Plural.
<shka_>
effort has been made
<beach>
Anyway, I am off to spend time with my (admittedly small) family.
<shka_>
good night
<shka_>
don't put to much effort into thinking about databases
<shka_>
at this point potential for the change is minimal, everybody wants to have database in a separate docker etc.
<shka_>
it is overly complex and wastes people time but it was tamed so nobody cares anymore
Jesin has joined #lisp
sauvin has quit [Read error: Connection reset by peer]
<asarch>
Everybody should write his own Lisp, at least once in the life
ogamita has quit [Ping timeout: 240 seconds]
<asarch>
And when you write your own implementation, how do you know if it is 100% compatible with the standard?
<jackdaniel>
how does doatabase imply copying?
<asarch>
Are there any tests about it?
<jackdaniel>
asarch: there are ansi-tests written by pfdietz, they are very useful when looking for non-conformities
<shka_>
asarch: T
Achylles has joined #lisp
vlatkoB has quit [Remote host closed the connection]
<grewal>
asarch: Bootstrap another implementation and run their tests
smasta has quit [Ping timeout: 255 seconds]
<p_l>
beach: have you seen GemStone/S? While it's proprietary, the source should be interrogatable at runtime, and it's based about object persistence at language level, iirc
karlosz has joined #lisp
karlosz has quit [Client Quit]
karlosz has joined #lisp
k-hos has joined #lisp
warweasle has joined #lisp
keep_learning_M has quit [Ping timeout: 250 seconds]
karlosz has quit [Quit: karlosz]
rumbler31 has quit [Remote host closed the connection]
keep_learning_M has joined #lisp
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
kenu has joined #lisp
hiroaki has joined #lisp
makomo has joined #lisp
knicklux has joined #lisp
kenu has quit [Ping timeout: 246 seconds]
eddof13 has quit [Quit: eddof13]
vms14 has joined #lisp
eddof13 has joined #lisp
<vms14>
It is right what lispers say about lisp changes your mind
<vms14>
It's too soon for me to have changed, but I start to see how you change your mind gradually while learning lisp
<vms14>
I guess the first step is realizing everything is made of abstractions and the way you don't care about non-yet-defined things. But I cannot explain it well since I'm only having a little taste of common lisp
cantstanya has quit [Remote host closed the connection]
aeth has quit [Ping timeout: 255 seconds]
aeth has joined #lisp
varjag has joined #lisp
nanoz has quit [Quit: Leaving]
knicklux has quit [Remote host closed the connection]
angavrilov has quit [Remote host closed the connection]
<aeth>
vms14: It's kind of the opposite of abstractions here. Almost every other language offers heavily abstracted syntax.
rumbler31 has joined #lisp
<vms14>
I mean, you make your way with abstractions
<vms14>
and lisp is one of the best languages for creating abstraction
<aeth>
for foo[42] instead of (aref foo 42) and saving maybe half a second of typing and a few characters, you lose a lot, particularly the ability to conveniently define your own syntactic abstractions
<vms14>
having abstractions limits you
<vms14>
but creating them is what we do more or less in almost every program
zotan has quit [Ping timeout: 252 seconds]
<aeth>
Well, I mean, many languages are stuck with (aref (aref foo 42) 15) instead of (aref foo 42 15) because they're stuck with foo[42][15] instead of having a true foo[42,15] or whatever because that would require new syntax
<vms14>
I like C because it lets or even forces me to build things from almost the scratch
<aeth>
So even in my simple example what seems harder winds up being more powerful because it's extensible
<vms14>
lisp not only lets me build, it also has a lot of builtin functions prepared just to create abstraction
zotan has joined #lisp
rumbler31 has quit [Ping timeout: 246 seconds]
<vms14>
I mean, since the first time I saw lisp in lisp books or tutorials, I saw lispers are making the pieces more little than what I usually see
<aeth>
The slightly more inconvenient syntax encourages more abstractions, too.
<aeth>
You see stuff like with-accessors
<vms14>
idk how to explain, but In C one function usually does one thing
<vms14>
in lisp one function also does one thing ( if the programmer wants ) but it does that thing using a lot of functions which usually are not builtin functions, but created by the programmer
<vms14>
every function is a layer or a step to reach the goal
<vms14>
things are more modular
<aeth>
You can write Lisp in any language. I certainly layer my trivial functions Lisp-style even in C
<vms14>
so you made your mapcar in C
<aeth>
No, I mean layers of functions (though higher order functions is, of course, a Lisp feature)
<aeth>
You can e.g. do most of the input error checking in one function and then a function unencumbered by that noise that just implements the logic.
<vms14>
I'm just trying to make some sort of transpiler to C
<aeth>
Each function being trivial, short, and doing one simple thing is very Lisp-style
<vms14>
doing noob stuff like creating functions for declare a variable and sum that variable
<aeth>
You *can* do syntactic abstraction in C but don't. Lisp has many advantages over C there. Yes, at that point, just transpile and use s-expressions as your actual source.
<vms14>
xD
<vms14>
I was wondering if read from input or wrap the input with parens
<vms14>
so the user is actually calling functions without knowing it
<vms14>
but I guess I'll start with just the (read) function which gives me symbols and start parsing symbols
<vms14>
I need to learn how to parse, and I'll cry when things go more complicated, but it's just for fun and I'll learn by the way
<aeth>
vms14: oh please don't do that (adding implicit ()s around foo to make (foo) and then calling it), that's basically as safe as calling eval() in other languages
<vms14>
I'll start reading symbols and converting symbols to string when needed with (string symb)
xkapastel has quit [Quit: Connection closed for inactivity]
shka_ has quit [Ping timeout: 245 seconds]
<vms14>
It will take time to do that, and I want to do first one html generator to practice
<vms14>
but I want start soon at least trying to bind variables and how to organize data
<vms14>
I guess the thing I like more of programming is metaprogramming and ai
xkapastel has joined #lisp
hiroaki has quit [Ping timeout: 252 seconds]
<aeth>
vms14: can you describe exactly what you're trying to do?
eddof13 has quit [Ping timeout: 245 seconds]
<vms14>
aeth: learn common lisp
<vms14>
I'd like to use common lisp as a parser sooner or later, so while I'm a noob I try to at least do noob stuff
<vms14>
also I want to see how lisp changes my mind as a programmer
<vms14>
and every day I learn about lisp I like it more
<vms14>
<3
cranes has joined #lisp
smasta has joined #lisp
jayemar has quit [Quit: afk]
vms14 has quit [Quit: WeeChat 2.3]
interruptinuse has joined #lisp
mindCrime has quit [Ping timeout: 255 seconds]
kajo has joined #lisp
amerlyq has quit [Quit: amerlyq]
Achylles has quit [Ping timeout: 252 seconds]
Arcaelyx has joined #lisp
Bike has quit []
LiamH has quit [Quit: Leaving.]
<makomo>
huh damn, cl-ppcre is such a magical and beautiful thing :-)
<makomo>
just when i thought i ran into an ""issue"" with its property resolvers, edi has already thought of it https://edicl.github.io/cl-ppcre/#*property-resolver*
<makomo>
note the ";; quiz question - why do we need CREATE-SCANNER here?" :-)
<makomo>
a very good quiz question actually
<makomo>
hint: compiler macros and LOAD-TIME-VALUE
<makomo>
my usage was (let ((cl-ppcre:*property-resolver* ...)) (ppcre:scan <string> <string>))
<makomo>
also, a very cool late night regex trick: splitting using zero-width positive lookaheads -- use the regex "(?=<delimiter>)"
<makomo>
the fact that it's zero-width means that it doesn't actually remove the delimiter
<makomo>
the cool thing is that you can use literally any regex for <delimiter>, including stuff like character properties. that way you can split on uppercase letters and such, without removing them
rumbler31 has joined #lisp
karlosz has joined #lisp
rumbler31 has quit [Ping timeout: 245 seconds]
milanj has joined #lisp
karlosz has quit [Quit: karlosz]
wxie has joined #lisp
lumm has quit [Quit: lumm]
nowhereman has joined #lisp
sjl_ has quit [Ping timeout: 245 seconds]
smasta has quit [Ping timeout: 245 seconds]
klltkr has joined #lisp
smasta has joined #lisp
varjag has quit [Quit: ERC (IRC client for Emacs 26.1)]
jdz has quit [Ping timeout: 244 seconds]
smasta has quit [Ping timeout: 255 seconds]
rumbler31 has joined #lisp
Essadon has quit [Quit: Qutting]
rumbler31 has quit [Ping timeout: 245 seconds]
karlosz has joined #lisp
jdz has joined #lisp
didi has joined #lisp
<didi>
What is the rationale for REDUCE calling FUNCTION with no arguments? I understand the situation (no initial value and empty sequence), but I've never encountered a situation where I wanted it to happen.
<pjb>
(defun cons* (&optional (a nil ap) d) (if ap (cons a d) 'ha)) (reduce (function cons*) '()) #| --> ha |#
<pjb>
didi: basically, the function without argument returns the neutral element for the operation, so that reduce can return something meaningful when you call it with an empty list and no :initial-value argument.
<didi>
pjb: I usually put the "neutral element" on :INITIAL-VALUE. Maybe I should rethink it.
<pjb>
Unfortunately, the function is not called with a singleton: (reduce (function cons*) '(1)) #| --> 1 |#