abhixec has quit [Remote host closed the connection]
libre-man has quit [Ping timeout: 245 seconds]
akoana has left #lisp ["Leaving"]
Misha_B has joined #lisp
<Misha_B>
Is there a way to declare the type of a slot in a class?
hatchback176 has joined #lisp
reelox6 has joined #lisp
Lord_of_Life_ has joined #lisp
<PuercoPop>
Misha_B: slot declarations accept the :type as an argument
<PuercoPop>
Most(all?) implementations just ignore it though. If you want to enforce it at run-time check quid-pro-quo
Lord_of_Life has quit [Ping timeout: 248 seconds]
Lord_of_Life_ is now known as Lord_of_Life
reelox6 has left #lisp [#lisp]
<aeth>
you can use the MOP to enforce an assert at slot access, including a typep assert
torbo has joined #lisp
<aeth>
that will be read/write, and all access, including creation
libre-man has joined #lisp
peterhil has quit [Read error: Connection reset by peer]
peterhil has joined #lisp
peterhil has quit [Read error: Connection reset by peer]
peterhil has joined #lisp
hatchback176 has quit [Remote host closed the connection]
wxie has joined #lisp
mindCrime has joined #lisp
rocx has joined #lisp
clintm has joined #lisp
<Misha_B>
MOP?
<no-defun-allowed>
meta-object protocol
peterhil has quit [Read error: Connection reset by peer]
peterhil has joined #lisp
alexanderbarbosa has joined #lisp
marusich has joined #lisp
NickBusey has joined #lisp
hatchback176 has joined #lisp
<PuercoPop>
aeth: that is what quid-pro-quo does
aedb has joined #lisp
<solrize>
keel
<solrize>
oops
<solrize>
nm
flazh has quit [Ping timeout: 268 seconds]
peterhil has quit [Read error: Connection reset by peer]
peterhil has joined #lisp
Lycurgus has quit [Ping timeout: 245 seconds]
<aeth>
PuercoPop: well that's what I do, too, it's a very, very small amount of code. It doesn't really fit anywhere in particular, but if I made it into its own library it would be bordering on JS-library level of conciseness
<PuercoPop>
fiddlerwoaroof: that is more inline with the npm style aeth was mentioning. Alexandria is too spartan so there are still more utilities needed. But with I like the sweetspot Serapeum hits, less conservative but still curated.
wigust- has quit [Ping timeout: 245 seconds]
<fiddlerwoaroof>
What I like about quickutil is that it can be used to pull the utilities into a utils.lisp in your project automatically.
<fiddlerwoaroof>
So, I can have a bunch of utilities without dependencies
<aeth>
PuercoPop: I feel hesitant to modify existing things. I'm also not sure how this would interact with an implementation that actually does check. Would it check twice?
<fiddlerwoaroof>
Serapeum is a bit problematic because it pulls in some non-trivial transitive dependencies.
froggey has quit [Ping timeout: 268 seconds]
<aeth>
fiddlerwoaroof: I agree. I think there's room for a utility library that only depends on alexandria and uiop and maybe the popular portability libraries like bordeaux-threads and trivial-features
froggey has joined #lisp
<aeth>
Even just using alexandria and uiop you can't... :use them because they have name conflicts, though
<White_Flame>
aeth: yet those are dependencies and against the rules of quickutil
<White_Flame>
I wonder if quickutil should be a good place for a lot of smaller trivial-* packages
<aeth>
Splitting a util library up into functions won't make a big different in CL (although it might, since tree shakers are uncommon). Splitting a util library up by dependencies probably could matter, though.
<White_Flame>
btw, I don't remember looking into quickutil before. I do like it
<aeth>
e.g. utils that depend on bordeaux-threads could be their own library
<aeth>
Hmm... Actually, you can use package-inferred-system to split each directory and file into its own ASDF system, and if they have their own independent dependencies that will achieve a similar effect.
<fiddlerwoaroof>
It's more that I much rather not have a dependency on a "utility library", I'd much rather just have a utils.lisp that I generate and update every once in a while.
<aeth>
That's how it starts. I had a utils, then I had a util/util, and now I have far too many utils in the util directory, and I'm pulling in a dependency on my incomplete game engine for almost every project I write.
nmg has joined #lisp
<aeth>
(I use package-inferred-system, though, so I only depend on zombie-raptor/utils)
<White_Flame>
we have a separate simple-utils system. It's 4 kloc now
<White_Flame>
"simple" :-P
<White_Flame>
350 functions & macros
<White_Flame>
although it smells like maybe quickutil would be a good place to submit many of them
<White_Flame>
I do kind of disagre with curation that allows simple renames like positivep
keep_learning_M has joined #lisp
Lycurgus has joined #lisp
<fiddlerwoaroof>
Yeah, I haven't looked at the particular items in quickutil, just more at the concept of replacing utility libraries with a system for generating a bunch of code for the utilities one wants
Arcaelyx_ has quit [Ping timeout: 246 seconds]
nmg has quit [Remote host closed the connection]
nmg has joined #lisp
nmg has left #lisp [#lisp]
FreeBirdLjj has joined #lisp
marusich has quit [Remote host closed the connection]
<aeth>
White_Flame: actually using it will destroy performance, too, since it's not using anything clever, or even an inline function, it's just a defun
<aeth>
It's taking something that a compiler could potentially even turn into a constant, and turning it into a function call, e.g. (plusp 1)
nanoz has joined #lisp
FreeBirdLjj has quit [Ping timeout: 248 seconds]
<White_Flame>
aeth: yep
<White_Flame>
as well, a precedent of renaming standards for local use would mean that even within quickutils, people can locally rename utility functions. That's not great. If there's a standard name for a function, it should be used
<White_Flame>
that's kind of the entire point of centralizing a set of functions
aedb has quit [Remote host closed the connection]
<beach>
Good morning everyone!
<aeth>
White_Flame: I can understand a renaming project, but that has to be more like cl21 or whatever they called it. An attempt to basically build a new language on top of CL and basically the opposite of a util library.
<aeth>
(cl21 is terribly named because there might be a CL standard in two years. Unlikely now, and more unlikely now than whenever that project came out, but still possible.)
<White_Flame>
and that creates a new standard name, obsoleting the old one. everything in cl21 and such should use their globally standard names for things
<aeth>
right
<White_Flame>
effectively as a programming environment, not a library
<aeth>
utils should look like built-ins
libertyprime has quit [Ping timeout: 272 seconds]
_whitelogger has joined #lisp
actuallybatman has quit [Read error: Connection reset by peer]
nanoz has quit [Ping timeout: 245 seconds]
dale has quit [Quit: dale]
flazh has joined #lisp
mindCrime has quit [Ping timeout: 244 seconds]
mindCrime has joined #lisp
actuallybatman has joined #lisp
actuallybatman has quit [Remote host closed the connection]
eMBee has quit [Ping timeout: 245 seconds]
eMBee has joined #lisp
notzmv has quit [Remote host closed the connection]
notzmv has joined #lisp
SaganMan has joined #lisp
xkapastel has quit [Quit: Connection closed for inactivity]
notzmv has quit [Ping timeout: 248 seconds]
Lycurgus has quit [Ping timeout: 245 seconds]
torbo has quit [Remote host closed the connection]
t58 has joined #lisp
<pjb>
aeth: positivep = not minusp
zigpaw has quit [Remote host closed the connection]
<pjb>
aeth: cl21 is cl for 21st century. It could come in 2099 and be timely.
<pjb>
Probably less likely in 2050 than in 2021 though…
<pjb>
In conclusion, you can forget cl21, it will never occur.
<aeth>
pjb: My point is "cl21" is a terrible name because if there was a standard in 2021 it would probably be referred to as "CL21", just like C++17 is the C++ standard from 2017
<pjb>
Nope. We're not as dumb as C++ programmers. We'd name it CL2021.
<pjb>
Remember we have bignums.
<White_Flame>
pjb: the source code for positivep is literally just calling plusp
frgo has quit [Read error: No route to host]
<pjb>
White_Flame: yes, because they use the wrong anglo-saxon definition.
frgo has joined #lisp
<pjb>
But in France, (positive x) = (<= 0 x) (strictly-positive x) = (< 0 x)
<aeth>
clearly, there needs to be a cl-fr because French is the international language of diplomacy
<pjb>
:-)
zotan has quit [Ping timeout: 272 seconds]
zotan has joined #lisp
<aeth>
(defmacro et (&rest les-formes) `(and ,@les-formes)) ; etc
vlatkoB has joined #lisp
<pjb>
aeth: if there was not the nil problem (and other self evaluating constants in general), it would have have been done a long time ago already.
<aeth>
Now that beach has a CL reader, one can just fork (or extend?) that.
hiroaki has joined #lisp
<White_Flame>
pjb: even in american english math, zero is neither positive nor negative, so positive would be strictly-positive
hiroaki has quit [Ping timeout: 248 seconds]
<White_Flame>
but loosely, people still take positive as non-negative
donotturnoff has joined #lisp
hatchback176 has quit [Remote host closed the connection]
eMBee has quit [Ping timeout: 246 seconds]
dale has joined #lisp
eMBee has joined #lisp
notzmv has joined #lisp
orivej has joined #lisp
donotturnoff has quit [Ping timeout: 245 seconds]
X-Scale has quit [Quit: HydraIRC -> http://www.hydrairc.com <- Nine out of ten l33t h4x0rz prefer it]
bendersteed has joined #lisp
manualcrank has quit [Quit: WeeChat 1.9.1]
peterhil has quit [Read error: Connection reset by peer]
makomo has joined #lisp
peterhil has joined #lisp
sauvin has quit [Ping timeout: 248 seconds]
Lycurgus has joined #lisp
ebrasca has joined #lisp
sauvin has joined #lisp
dale has quit [Quit: dale]
xantoz has quit [Ping timeout: 258 seconds]
bendersteed has quit [Ping timeout: 245 seconds]
<solrize>
i'm used to positive = > 0
yangby has joined #lisp
beach has quit [Ping timeout: 258 seconds]
yangby has quit [Client Quit]
<frgo>
Hi. I am fighting with format. No, not with some format control stuff, but with how to make a string contain the character sequence "\n" literally.
<frgo>
(format nil "\\n") doesn't work. How to I escape or just make backslash be a simple character in that string?
q9929t has joined #lisp
q9929t has quit [Ping timeout: 258 seconds]
random-nick has joined #lisp
<LdBeth>
frgo: you mean (format nil "\\n") gives "\\n"?
<frgo>
LdBeth: Yep.
* LdBeth
shit, the irc client I use also escapes // thing
<LdBeth>
So I’d leave this question to someone else or I get home to use a proper one
<ck_>
Hmm, I thought *print-escape* controlled that, but I was wrong
<frgo>
LdBeth: Thanks for your efforts
<frgo>
ck_: Yeah...
<ck_>
frgo: but it really is just a printer issue
<ck_>
try (length "\\n")
<LdBeth>
Or (format t
<frgo>
ck_: The problem is, well, that the printer does print it as \\.
<LdBeth>
Common Lisp also escape when print a string as "..."
<frgo>
I can't do (format t ...) as I am building a larger string that is given to a function.
<LdBeth>
I mean, you can try to type that in repl
<LdBeth>
Testing and experimenting stuff
<ck_>
frgo: why is that a problem? You wanted a string that contains a backslash and an 'n'. That's what you have
<moldybits>
(length (format nil "\\n")) ; => 2
<frgo>
LdBeth: I do ;-)
<ck_>
frgo: how it is printed is no issue if you intend to pass it to another function.
<LdBeth>
So "\\\\n" is what you need
<LdBeth>
Common Lisp print it like that so it can be read back
<LdBeth>
ck_: that’s to frgo, sorry if it makes you confuse
<frgo>
I see I have an issue not with printing per se, but with the function that consumes the string. I use JONATHAN to output JSON ...
q9929t has joined #lisp
<ck_>
LdBeth: I understand that, but I don't know why you put four backslashes; if [newline] gets printed readably with two backslashes, that's all you need. Hence the huh. Sorry for interjecting.
<LdBeth>
ck_: so it display as two on my screen. : (
beach has joined #lisp
q9929t has quit [Read error: Connection reset by peer]
cantstanya has quit [Remote host closed the connection]
<ck_>
I don't know what's happening here : / are you training for the pedantry olympics?
zotan has quit [Ping timeout: 245 seconds]
zotan has joined #lisp
<pjb>
ck_: Nope. I'm just totally flaggerblasted by such questions.
<pjb>
"\n" == "n" What else is there to understand?
<moldybits>
lol
<pjb>
(format nil "\\n") works perfectly and returns "\\n".
<pjb>
What else could it return?
<ck_>
pjb: yes, I do know that. The issue was more with the confusion about how it is printed, and not on my part
<ck_>
which is what the entire conversation was about
<pjb>
Yes, but it doesn't involves newlines at all.
<frgo>
pjb: Yep. But how to make it *print* "\n"
<pjb>
(format t "\\n") #| \n --> nil |#
<pjb>
format nil doesn't print, it builds a new string.
<pjb>
Again, flaggerblasted. It's the first thing written in clhs format
<pjb>
If destination is a string, a stream, or t, then the result is nil. Otherwise, the result is a string containing the `output.'
<pjb>
<pjb>
<ck_>
pjb: again, that's where the pedantry comes in. I was avoiding using the string '\n' because the client of the person I was speaking with escapes backslashes on the display.
<pjb>
Then you should have said backslash and n, not newline. Newline doesn't exist here.
<ck_>
also part of the conversation were other standards, like json, in which backslash-n is code for?
<ck_>
"doesn't exist here" :) ok. you're probably just having a bad day
zigpaw has joined #lisp
<frgo>
Ok, i see I need to be more precise. I want to create a string using 'format that containts the character sequence "\n".
<pjb>
Was the question about how to include a newline in a string literal?
<pjb>
Because if it was, I didn't see the answer to that question.
<ck_>
was I answering that question in that line you were commenting on?
<frgo>
A character Backslash and a character n.
<pjb>
frgo: "\n" is a sequence of 1 character, the character #\n
<pjb>
(length "\n") #| --> 1 |#
<pjb>
(map 'list 'string "\n") #| --> ("n") |#
<pjb>
frgo: if you want two characters, (map 'string 'identity #(#\\ #| and |# #\n)) #| --> "\\n" |#
<moldybits>
"(In the standard readtable, slash is the only single escape.)" <- this is a bug in the spec, right?
<frgo>
pjb: I need to come up with a sequence of the character \ and the character n. But as I said: It's not a problem of printing per se. It is a problem of me using JONATHAN to create a JSON string that escapes again.
<pjb>
moldybits: good catch. It's a legacy. In Zeta Lisp, / was the escape, not \. But in CL, it's \ :-)
Urfin has joined #lisp
Arcaelyx has joined #lisp
nowhere_man has joined #lisp
nowhereman has quit [Ping timeout: 245 seconds]
<ck_>
frgo: so, is your problem solved now?
<frgo>
ck_: No. But I went on and implemented a workaround. Thanks for asking.
SaganMan has quit [Ping timeout: 248 seconds]
SaganMan has joined #lisp
<ck_>
frgo: from what I understand your issue to be, I'd say it worked fine from the beginning and the printer confused you about the contents of your strings
nanoz has joined #lisp
lavaflow_ has quit [Ping timeout: 248 seconds]
SaganMan has quit [Ping timeout: 245 seconds]
SaganMan has joined #lisp
nanoz has quit [Read error: Connection timed out]
nanoz has joined #lisp
<frgo>
ck_: Yes, but ... JONATHAN does escaping when creating a JSON string. That is my problem.
<ck_>
frgo: just guessing here, but what if you put an actual newline in there? (jonathan:to-json (format nil "a string~%"))
<White_Flame>
I still don't understand the problem. What are you giving it, what result do you get, and what result do you want?
<White_Flame>
it hasn't been fully expressed yet
<ck_>
I'm also still wondering, and would like some closure.
<White_Flame>
because everything has been sensible so far, but you say it's wrong?
mindCrime has quit [Ping timeout: 245 seconds]
<frgo>
ck_: Thanks for the suggestion. This won't help me as I need a STRING containing the characters \ and n in it. This needs to be the result of JONATHAN output., i.e. (jonathan:to-json ***something***) need to produce sth like: { "text": "\n" } where \n is a string of two characters.
<White_Flame>
it seems like you're asking jonathan to create broken JSON, though
<White_Flame>
because "\n" isn't a string of two characters in JSON
<White_Flame>
afaik
<frgo>
No. I definitely do not.
<frgo>
Saying it again: I need a string, not a newline or linefeed or sth else. I need a string of two characters.
<White_Flame>
"\\n" in JSON is a string of two characters
<ck_>
frgo: in common lisp, what you see printed as "\\n" is a string of two characters. That's what people are telling you
<frgo>
I am passing this to Slack for getting a message printed in a channel. I want to use Slack's markdown, which uses the string "\n" as a markdown element.
<frgo>
Ok, so then: What sequence of characters do I need to call to 'jonathan:write-value such that I get a string of the two chars \ and n?
<White_Flame>
sure, so you need to produce { "text": "\\n" } for that
* frgo
goes for lunch
<White_Flame>
because that will read *in JSON* as a string of 2 characters, a backslash and an 'n'
<pjb>
frgo: again, you are confusing the way lisp prints string values, and the way string values are printed!
<ck_>
frgo: If you do this: (with-open-file (s "/tmp/backslash-n" :direction :output) (format s "\\n")), you'll see the two characters you want in /tmp/backslash-n.
<pjb>
That's because the string "\\foo" only contains 4 characters.
<Lycurgus>
why do some people think it's OK that CCL doesn't support generic functions?
mindCrime has joined #lisp
<pjb>
Lycurgus: We demand to know why!
<White_Flame>
frgo: and the particular string "\\n" follows the exact same escaping rules in both CL and JSON
<Lycurgus>
pjb, ikr?
<pjb>
Lycurgus: you know that international standards, like ANSI CL are promoted by the UN. I think it's start we organize a demonstration in front of the UN building in NY to demand that ClL support generic functions!
<pjb>
s/ClL/CCL/
<Lycurgus>
i think there's some line of thinking that CLOS is effectively delivered without in the case of this implementation
<Lycurgus>
or maybe that CLOS isn't all that big a deal or doesn't require MOP or i dunno what
<kenu>
you mean to parse this :RAW-BODY #<FLEXI-STREAMS::VECTOR-INPUT-STREAM {1003F9A5A3}>
<kenu>
?
<no-defun-allowed>
i think so, yeah
SaganMan has joined #lisp
Urfin has left #lisp ["ERC (IRC client for Emacs 27.0.50)"]
<no-defun-allowed>
prolly best to use something like hunchentoot that actually handles things like this for you
cosimone has joined #lisp
shka_ has joined #lisp
<shka_>
hi
<shka_>
how can i inform my lisp implementation (sbcl) that vector is adjustable and contains a fill pointer so it will be inclined to optimize length calls and so?
void_pointer has joined #lisp
<ck_>
shka_: you mean the :adjustable and :fill-pointer &key arguments to make-array? Or are you talking about permanently modifying the type vector
<shka_>
ck_: preferable creating my own custom type is said does not exist
cosimone has quit [Quit: WeeChat 2.3]
<shka_>
i did that already, and simply added satisfies calls to common lisp predicates
<shka_>
i wonder if this is the correct way to do so
<ck_>
so you're talking about deftype then?
<shka_>
well, yes
simendsjo has joined #lisp
nanoz has quit [Ping timeout: 248 seconds]
simendsjo has quit [Client Quit]
flazh has joined #lisp
manualcrank has joined #lisp
flazh has quit [Read error: Connection reset by peer]
flazh has joined #lisp
<ck_>
were you about to paste something? You said you wondered if 'this' is the correct way
heisig has quit [Remote host closed the connection]
heisig has joined #lisp
heisig has quit [Remote host closed the connection]
lavaflow_ has quit [Ping timeout: 258 seconds]
heisig has joined #lisp
orivej has quit [Ping timeout: 272 seconds]
lavaflow_ has joined #lisp
v88m has quit [Remote host closed the connection]
v88m has joined #lisp
nanoz has quit [Ping timeout: 245 seconds]
j11s has joined #lisp
nanoz has joined #lisp
gravicappa has joined #lisp
Finnfinn has quit [Quit: The humanity!]
Finnfinn has joined #lisp
Arcaelyx has quit [Read error: Connection reset by peer]
notzmv has quit [Ping timeout: 258 seconds]
xkapastel has joined #lisp
rippa has joined #lisp
sz0 has joined #lisp
Arcaelyx has joined #lisp
Arcaelyx has quit [Read error: Connection reset by peer]
Arcaelyx has joined #lisp
Arcaelyx has quit [Read error: Connection reset by peer]
Arcaelyx has joined #lisp
Arcaelyx has quit [Read error: Connection reset by peer]
peterhil has quit [Quit: Must not waste too much time here...]
Arcaelyx has joined #lisp
Arcaelyx has quit [Read error: Connection reset by peer]
Arcaelyx has joined #lisp
Arcaelyx has quit [Read error: Connection reset by peer]
orivej has joined #lisp
slyrus_ has joined #lisp
keep_learning_M has quit [Quit: This computer has gone to sleep]
Jesin has quit [Quit: Leaving]
lnostdal has joined #lisp
<moldybits>
frgo: nice :)
lnostdal has quit [Remote host closed the connection]
lnostdal has joined #lisp
<pjb>
shka_: why is extendable-vector not simple-array?
<pjb>
AFAIK, simple-array can be adjustable, depending on the implementation.
Jesin has joined #lisp
orivej has quit [Ping timeout: 245 seconds]
<moldybits>
"It is implementation-dependent whether displaced arrays, vectors with fill pointers, or arrays that are actually adjustable are simple arrays."
<moldybits>
"The type of an array that is not displaced to another array, has no fill pointer, and is not expressly adjustable is a subtype of type simple-array."
<moldybits>
subtype is probably the keyword there
<pjb>
The point is that the sets can intersect.
<pjb>
and be equal.
arnaudga has joined #lisp
torbo has joined #lisp
eMBee has quit [Ping timeout: 245 seconds]
slyrus__ has joined #lisp
slyrus_ has quit [Ping timeout: 246 seconds]
Josh_2 has quit [Quit: ERC (IRC client for Emacs 26.1)]
eMBee has joined #lisp
torbo has quit [Remote host closed the connection]
burtons has joined #lisp
datajerk has joined #lisp
dacoda has joined #lisp
funnel has quit [Ping timeout: 246 seconds]
dacoda has quit [Ping timeout: 245 seconds]
elosant has joined #lisp
funnel has joined #lisp
jeosol has quit [Ping timeout: 256 seconds]
jgodbout has quit [Ping timeout: 256 seconds]
simendsjo has joined #lisp
simendsjo has quit [Remote host closed the connection]
Harag has joined #lisp
nowhereman has quit [Ping timeout: 258 seconds]
Harag has quit [Client Quit]
v88m has quit [Ping timeout: 245 seconds]
ebrasca has quit [Remote host closed the connection]
Arcaelyx has joined #lisp
elosant has quit [Remote host closed the connection]
elosant has joined #lisp
v88m has joined #lisp
<flip214>
Is VECTOR-PUSH-EXTEND thread-safe? In SBCL?
t58_ has joined #lisp
t58 has quit [Ping timeout: 258 seconds]
Nomenclatura has joined #lisp
t58_ is now known as t58
soda__hobart has joined #lisp
vlatkoB has quit [Remote host closed the connection]
<arnaudga>
Hello there, which web framework would you advice me ? It's a quit open question but I would like something for the real world
Lycurgus has joined #lisp
<soda__hobart>
hi everybody, sorry for asking a mad babyish question, but I just started but I'm confused about how scope works. I'm trying to write a simple sorting program: https://pastebin.com/p17WjmB2 How do I increment the x and y variables? CLisp says that (+ x 1) should be a lambda, but semantically, I want to increment the actual x variable that I declared earlier.
random-nick has quit [Ping timeout: 248 seconds]
mindCrime has joined #lisp
elosant has quit [Quit: WeeChat 2.4]
<MichaelRaskin>
arnaudga: I have used hunchentoot as the web server, and restas on top of it — mostly for handling parameters-inside-routes
<MichaelRaskin>
They definitely work
<shka_>
soda__hobart: numbers can't be mutated, and therefore all math operators can't mutate object, however you can change bindings of variable by using setf macro
sz0 has quit [Quit: Connection closed for inactivity]
<shka_>
for instance (setf x (+ x 10))
<shka_>
furthermore, there is a shortcut macro just for doing this, called incf
<shka_>
it allows you to write just (incf x 10)
<moldybits>
soda__hobart: you're trying to call (+ x 1) as a function: ((setq x (+ x 1)) (setq y (+ y 1)) (list-pairs-recursive))))
<soda__hobart>
oh, I see now, that makes sense
<shka_>
also, what the heck is happenineg in sort-nums
<shka_>
soda__hobart: it kinda looks like some fucked-up python code
<shka_>
gotcha? ;-)
<soda__hobart>
shka_: haha, yes it does
<shka_>
well, for starters, use let
<shka_>
(let ((x 0) (y 1)) ...
<shka_>
secondly, use labels for recursive local function
nanoz has quit [Ping timeout: 272 seconds]
<arnaudga>
MichaelRaskin, ok thanks, I will have a look on this solution
<shka_>
CL is kinda explicit and operators are mostly doing just one thing at the time
<shka_>
so defun is JUST for declaring global functions
<MichaelRaskin>
arnaudga: there are many other options, though
<shka_>
not local
Krystof has joined #lisp
<shka_>
soda__hobart: i am pointing this out so you can somewhat align yourself to how
<shka_>
CL is constructed
<soda__hobart>
shka_: sweet, yes, i appreciate it a lot!
<shka_>
also, you can use a book i think
<moldybits>
(in scheme functions defined within another are local to those functions, i think)
<shka_>
moldybits: CL is not like that, cl is almost as explicit as it gets
<shka_>
while scheme is minimalistic
<arnaudga>
MichaelRaskin, I think so, I like to have feed back from the community
<soda__hobart>
I'm looking at Practical Common Lisp
<shka_>
it is a pretty good book
<MichaelRaskin>
arnaudga: my choice of hunchentoot is quite old, so maybe you want to get some opinions from people who surveyed the situation recently
rjid has joined #lisp
rjid has quit [Remote host closed the connection]
<shka_>
soda__hobart: anyway, PCL is probably the best intro for CL nowdays, other decent books include Land Of Lisp, ANSI common lisp, and PAIP
<shka_>
PAIP is excellent book in it's own right but i consider it to be worse as cl introduction
<moldybits>
paip is FUN
<shka_>
worth reading more if you are already established as lispers
<soda__hobart>
PCL seems pretty cool, i like how it has both more in-depth discussions but then also practical examples.
<shka_>
btw, i literally have PAIP open next to me in this very moment
khisanth_ has quit [Ping timeout: 246 seconds]
<shka_>
also, norvig is such a cool guy
<arnaudga>
MichaelRaskin, it would be nice...but this environment is not too popular in web dev :-/
aedb has joined #lisp
v88m has quit [Read error: Connection reset by peer]
v88m has joined #lisp
<edgar-rft>
arnaudga: there's #lispweb, maybe somebody there knows...
<arnaudga>
edgar-rft, oh ok, let's go :)
<soda__hobart>
PAIP looks real cool. I am working on my masters in library & information science and I am real interested in stuff like NLP, description logics & ontologies, so that's sort of my interest in learning Lisp.
<ck_>
that part, to me, has a certain patina on it
<ck_>
maybe I'm tainted from the valley of sobering that followed all those glorious AI-will-solve-everything announcements
<ck_>
but I agree that PAIP is still a great read
<shka_>
algorithms described in the PAIP can be used to solve all kinds of problems in everyday 'normal' software
<shka_>
it is well, useful stuff
<soda__hobart>
ck_: yeah the NLP stuff probably has changed a lot since early 1990s, but I'm not that hardcore into it--hardly a mathematician--I'm more trying to learn stuff that's useful for traversing graphs for knowledge management, data management kind of stuff.
vutral has quit [Ping timeout: 246 seconds]
Lycurgus has quit [Quit: Exeunt]
<shka_>
soda__hobart: have fun learning lisp
khisanth_ has joined #lisp
random-nick has joined #lisp
gravicappa has quit [Ping timeout: 248 seconds]
zacque has joined #lisp
ym has quit [Quit: Leaving]
cosimone has joined #lisp
libre-man has quit [Ping timeout: 245 seconds]
mindCrime has quit [Ping timeout: 245 seconds]
donotturnoff has quit [Ping timeout: 245 seconds]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
libre-man has joined #lisp
vutral has joined #lisp
akoana has joined #lisp
eMBee has quit [Ping timeout: 272 seconds]
eMBee has joined #lisp
mindCrime has joined #lisp
Josh_2 has joined #lisp
vutral has quit [Ping timeout: 248 seconds]
heisig has quit [Remote host closed the connection]
dale has joined #lisp
clothespin has joined #lisp
vutral has joined #lisp
makomo has joined #lisp
vutral has quit [Ping timeout: 248 seconds]
vutral has joined #lisp
soda__hobart has quit [Ping timeout: 252 seconds]
vutral has quit [Ping timeout: 258 seconds]
akoana has left #lisp ["Leaving"]
shka_ has quit [Ping timeout: 244 seconds]
<White_Flame>
flip214: arrays have no thread protections
<White_Flame>
although certainly an implementation can choose to do so
<White_Flame>
threads themselves aren't in the spec at all
elosant has joined #lisp
<elosant>
hello
<elosant>
im reading sicp and i pretty much have 0 knowledge of the langauge
<pjb>
elosant: for example, when we're in the last case, the if tree will test (< a b) and (< c b) (2 tests), while the ternary < will have to test (< c a) (< a b) (< a c) (< c b) (< c b) (< b a) !
<aeth>
pjb: both are still the same number of "operations", though. If you don't think below the level of built-ins
<elosant>
and the clause with the t predicate acts like an else?
<aeth>
pjb: You might be able to remove a few in the cond case. It would probably require too much thinking, though
<pjb>
elosant: now, your exercise would be to write a function that would generate such a if tree to find the 2 biggest numbers in a list of arguments of any length. (defun make-if-tree (real-vars binary-fun-name) …) (make-if-tree '(a b c d e f) sum-square) -> (if (< a b) … (if (< e f) (sum-square a b) (sum-square a e)) …)
<pjb>
elosant: (or (< x y z) (< x z y)) is better written (or (< x y) (< x z))
<pjb>
elosant: but if you have more than 3 variables, it's still better to use a if-tree than a sequence of such tests.
<elosant>
i'll attempt that once i get past chapter 1 lol
t58 has quit [Read error: Connection reset by peer]
t58 has joined #lisp
<aeth>
I suspect SICP is like Project Euler. If it's brand new material, you just want it to pass, but you can basically work on perfecting solutions forever.
<aeth>
You should write unit tests. You'll probably revisit some of your old answers.
<elosant>
perhaps i will for the more extensive exercises
<elosant>
do you write lisp in an ide or use vim/emacs like usual
<moldybits>
emacs is an ide
<Josh_2>
and an operating system
<elosant>
i mean something like drracket
<moldybits>
what does drracket have that emacs doesn't?
<White_Flame>
elosant: 't' is simply true, so the predicate will always pass
<White_Flame>
so it has the effect of an "else", but being a catch-all is probably a better way to think about it
emacsomancer has quit [Read error: Connection reset by peer]
<aeth>
elosant: Emacs is more popular than vim because Emacs itself is partially written in a Lisp language called Emacs Lisp.
<White_Flame>
(I don't consider emacs an IDE. It has no real integration of files together as a project)
<elosant>
ya and nobody uses vimscript
<White_Flame>
(although certainly everybody will have their own take on what the acronym implies)
<fiddlerwoaroof>
White_Flame: projectile/treemacs gives you that
emacsomancer has joined #lisp
<White_Flame>
a file explorer isn't an IDE
<aeth>
White_Flame: for me, something like SLIME is an IDE, although bare emacs is not.
<White_Flame>
thinking about it ... as aeth posted as I was typing, I would consider SLIME an IDE as well
<aeth>
it's one of those things where the lines are blurred on the border, though
<aeth>
e.g. the mode needs a functional M-. imo
<White_Flame>
(oops, seem to have crossed #lisp and ##lisp subjects. oh well, on topic in both ;) )
<fiddlerwoaroof>
Hmm, I guess that's right. There are good modes for most of the languages I use, though: Cider for Clojure tide or tern for JS, java-lsp
cosimone has quit [Quit: WeeChat 2.4]
<jmercouris>
emacs has several IDE implementations, that however does not make emacs an IDE
<jmercouris>
emacs is first and foremost an elisp library with a bunch of functions suited to text editing
<twanny796>
how can I get the manual?
<White_Flame>
manual for what?
Josh_2 has quit [Quit: ERC (IRC client for Emacs 26.1)]
<White_Flame>
twanny796: Common Lisp was an re-merging of various industrial spinoff languages, so it wasn't focused on inexperienced learners
<White_Flame>
s/an/a/
<White_Flame>
(at least in one view of things)
<White_Flame>
also, as it was popular in universities, the courses taught it as opposed to the language net-centers of today
<White_Flame>
(eg python.org or whatever)
<aeth>
Common Lisp was basically meant to replace Maclisp and Interlisp and Lisp Machine Lisp (and a few others), with some innovations from Scheme and (eventually) with an object system.
<aeth>
Common Lisp replaced all of the historic Lisps except for Scheme, which evolved into a more distinct language, and Emacs Lisp, which is tied to the GNU Emacs editor.
<White_Flame>
(although emacs lisp came afterc ommon lisp)
<White_Flame>
or at least very close
<aeth>
Emacs Lisp came after, but it is intentionally a historic Lisp in design because RMS didn't like parts of Common Lisp. And it feels like it's straight out of the 1980s.
<aeth>
(Even more than Common Lisp imo.)
makomo has quit [Ping timeout: 245 seconds]
<aeth>
Scheme doesn't have this because it broke compatibility, but that's also why there's way more software in Common Lisp than in Scheme.
<twanny796>
I think there's enough to get started in the Emacs manual?
<White_Flame>
started programming emacs lisp, or using emacs to program in common lisp?
techquila has quit [Remote host closed the connection]
random-nick has quit [Read error: Connection reset by peer]
<White_Flame>
the standard tools you want for CL development are a lisp implementation (SBCL is quite popular), emacs, SLIME (emacs support for a lisp ide), and quicklisp (downloading package manager for lisp)
<twanny796>
I want to understand .emacs first.
<aeth>
These days you don't need an elaborate .emacs because of M-x package-list-package if you install the MELPA repository. You do need to turn off a few ridiculous defaults and turn on a few things that should be default but aren't if you want a properly configured GNU Emacs for Common Lisp, beyond just installing some packages.
<aeth>
Iirc... you need (setq paredit-space-for-delimiter-predicates '((lambda (endp delimiter) nil))) if you use Paredit because it doesn't play nice with # forms. You also need (require 'slime-cl-indent) to get LOOP to indent properly. You also need (setq-default indent-tabs-mode nil) or else Emacs does an ugly mix of tabs and spaces.
<aeth>
Probably a few more
<aeth>
If anyone uses a custom extension, you need to add support for it, e.g. for s-expressions-as-configuration (add-to-list 'auto-mode-alist '("\\.sxp\\'" . common-lisp-mode))
<White_Flame>
but everything will generally work without that, especially for a beginner
<aeth>
Well you don't really need to know Emacs Lisp to run a handful of lines
<aeth>
Oh, you also need to turn on flyspell-prog-mode to spellcheck your strings and comments. Lots of trivial one-liners that pile up over time.
eMBee has quit [Ping timeout: 268 seconds]
elosant has quit [Quit: WeeChat 2.4]
varjag has quit [Ping timeout: 272 seconds]
eMBee has joined #lisp
mindCrime has quit [Ping timeout: 245 seconds]
<jmercouris>
how do you generally indent (defpackage xyz (:import-from :abc :a :b :c))?
<fiddlerwoaroof>
Two spaces before (:import-from
<fiddlerwoaroof>
(on new line)
<jmercouris>
I see, and what about the part that has `:abc :a :b`
<fiddlerwoaroof>
One line, as much as possible
<jmercouris>
and when it is multiple lines?
<fiddlerwoaroof>
otherwise, whatever emacs does
ltriant has joined #lisp
<fiddlerwoaroof>
(I think this is line up everything with :import-from)
<jmercouris>
I'm asking because if I have (:import-from :abc :a \r\n :b \r\n :c) emacs does a very strange indentation
<fiddlerwoaroof>
I just noticed that, though: it indents :b weird
<jmercouris>
emacs only likes to cooperate on indentation when I have everything on a newline
<jmercouris>
yeah it has been bothering me for about a year now
<fiddlerwoaroof>
My main annoyance is that I like to use aggressive-indent-mode, so I try to avoid using custom indentation
<fiddlerwoaroof>
Because aggressive-indent-mode will just revert it
lnostdal has quit [Remote host closed the connection]
<fiddlerwoaroof>
The behavior around import-from looks like a bug to me
<jmercouris>
I wonder how it treats other lists, let me try something
<jmercouris>
I get the same behavior in a simple quoted list with two elements on the first line
<jmercouris>
however I can't imagine when you would want the indentation to alternate between a little and a lot on every other line