<fengshaun>
I'm trying to get common lisp completion working with company mode and slime, I have set slime-contrib to slime-company and then call slime-setup. Company mode in a CL file only complete symbols in the buffer, not anything else
<aeth>
I mean, there really isn't an optimal solution for huge projects with tons of packages... much larger than practically any CL project gets. You can always use the package prefix (perhaps locally nicknamed), but now you need to find-and-replace any time you move something from one package to another, which is probably pretty likely if the project is very, very large.
<aeth>
You can USE, but that's potentially fragile, and I'd suggest to keep it to other "internal" packages.
<aeth>
Or you can explicitly IMPORT-FROM, which I tend to do, but most people don't. You can easily wind up with hundreds/thousands of lines of boilerplate with import-from, but you only have to change it once when you move it
<beach>
aeth: I think it is highly unlikely that code needs to be moved from one package to another.
<Nilby>
It looks like I have about 377 packages :(
<aeth>
beach: It really depends on how many packages you have. One-package-per-directory makes it fairly unlikely, but one-package-per-file makes it fairly likely, which is a bit of a disadvantage for things like package-inferred-system.
<Nilby>
I find it harder to maintain import-from, but I do like the specificity.
dvdmuckle has joined #lisp
<aeth>
One-package-per-system makes it very unlikely, but it doesn't scale very well to very, very large projects imo.
oxum has quit [Remote host closed the connection]
<beach>
aeth: As I have said many times, I don't see the advantage of a package per file. A package per module ought to be the norm.
<beach>
And it is highly unlikely to want to move code from one module to another.
<beach>
If it were likely, it means your module boundaries are not clear.
Alloc has quit [Ping timeout: 268 seconds]
<aeth>
Perhaps it depends on the project. My largest project is a game engine, which by the nature of the problem is a gigantic, interconnected mess. Trying to do decent software engineering out of it is the hardest challenge.
<Nilby>
I have approximately package per module.
iissaacc has quit [Ping timeout: 240 seconds]
<beach>
I don't see the point of trying to figure out modularity rules for code that is an intrinsic mess.
<aeth>
Even if I did one package per directory, I'd still need to rearrange things all of the time, and on the other side of things, I'd probably want to still have a bunch of one-file modules/packages, anyway. For things like wrapping SDL.
Alloc has joined #lisp
<Nilby>
Game engine is a great exmaple for the kind of problems I have with slot naming.
<edgar-rft>
aeth: sounds as if you're trying to re-invent the internet as a game
orivej has quit [Ping timeout: 240 seconds]
<Nilby>
Or the internet is trying to re-invent them as a game :)
kir0ul has quit [Ping timeout: 256 seconds]
<aeth>
beach: The problem with game engines aren't that the code's a mess, it's that the problem itself is a mess because pretty much the only thing that isn't very coupled is the sound.
<mfiano>
As a game engine developer, I can both agree and disagree that the modules and protocols are constantly evolving, even after many years of good software architecture.
<mfiano>
That said, I never use :USE for my tens of thousands of lines of game engine code across dozens of packages.
oxum has joined #lisp
<Nilby>
mfiano: Do you use import-from ?
<mfiano>
For complex systems, good protocol or not, it is more maintainable to use package-local nicknames, than to fit everything in owns' head where symbols come from, or increase noise with full package qualifiiers
<Nilby>
Or just prefixes?
<mfiano>
No I use PLN's
<autumn[m]>
out of curiosity are you also developing a game at the same time?
<autumn[m]>
(sorry, i'm nosy >.>)
<Nilby>
Ah. I made most of my mess before PLN's were easily usable.
oxum has quit [Remote host closed the connection]
oxum has joined #lisp
<mfiano>
Commonly used packages get brief local nicknames, and consistent for each package requiring their use, such as "A" for "ALEXANDRIA". Less commonly used ones are still short, but less so; just enough to clearly identify them. My actual packages are qualified with my domain name as "NET.MFIANO.LISP.*" as to be a good Common Lisp citizen and not introduce conflicts when one depends on my software in an
<mfiano>
image with a chance to collide with other global package names, so this works well for me.
galex-713 has joined #lisp
<pillton>
Do you include the nicknames in the package declaration?
<mfiano>
The local nicknames? Yes, unless my protocol is not yet well fleshed out and I require mutually recursive calls, which that wouldn't work for.
<mfiano>
I loathe mutually recursive packages, so that is rare, but sometimes happens when prototyping a new feature in a complex piece of machinery such as a game engine.
<pillton>
By mutually recursive packages do you mean packages which depend on each other?
<mfiano>
Yes, mutually-dependent is a more correct term. Sorry.
ex_nihilo has joined #lisp
<mfiano>
autumn[m]: I have been developing a game engine for about 10 years, and only recently started writing a game about 2 months ago. The game engine is not complete, but complete enough for writing the game I want at this point.
<no-defun-allowed>
Nilby: No, I only :use for e.g my utility library, and the CL package (of course), which isn't "a lot".
<mfiano>
So at this point in time I am now developing both in parallel
<no-defun-allowed>
Admittedly I have too many things in that utility library, including some "primitives" for binary input and output, thread utilities like locked boxes and WITH-THREAD, and now meters.
wxie has joined #lisp
galex-713 has quit [Quit: No Ping reply in 180 seconds.]
<no-defun-allowed>
But the point is I control both packages, and it's very unlikely that I'll get to developing anything with similar names or concepts in both packages, so it's not a big deal.
<beach>
autumn[m]: As an outside observer, I get the impression that there are more game engines than games in Common Lisp.
<mfiano>
For my personal utility package, I use a U: PLN, never :USE'ing the package, because my code is read by other game developers.
<aeth>
no-defun-allowed: I use USE for my utility library but it probably wouldn't make a big difference if I switched it to the prefix z
<autumn[m]>
hah. <.< The impression I got was that there were many attempts at game engines of varying completeness! but I haven't looked deeply.
<aeth>
mfiano: anyone who wants to know what it is can just M-., though
<no-defun-allowed>
I intend for my code to be read by no one, and that's also why we license with the Cooperat—no, I'm kidding. But I started writing before I knew of PLNs.
<Nilby>
aeth: M-., is really quite the killer feature of a development environment
<mfiano>
beach: There are a lot, because game engines are complex, much moreso than an operating system for example, requiring discipline in lots of branches of CS/maths/art. But there are not more than the number of games. The Lisp game jams over the past 10 years or so receives quite a few CL games from scratch, or on top of some existing engines.
<mfiano>
The Lisp curse of "I can do it better than anyone else" is also at play here. It would be nice if more engine authors could collaborate, given how much time and effort it takes.
<dbotton_>
but half the fun is doing it your way and from scratch
<no-defun-allowed>
Although, I do have one module that I think is very difficult to understand without being able to poke at it running, which implies -- hah, wow, I have never wanted to say [citation needed] more than in the past 30 seconds.
<Nilby>
no-defun-allowed: In practice not much of the nameing scheme matters, since I'll be suprised if anyone ever had to use my code.
<dbotton_>
I am sure most of these engines are not for pay
<Nilby>
I wrote a few small boring games without writing any gaming engines.
<dbotton_>
Is there an easy way to rename a single operator from a different package?
<aeth>
Ime, the different engines have very different approaches.
<aeth>
e.g. borodust's uses way more FFI (especially into C++!) than anyone else is comfortable with, but that's probably why the 2D trivial-gamekit part of it is very usable today
<no-defun-allowed>
They cannot be renamed; remember that packages work with symbols, and symbols have names that are always the same.
<no-defun-allowed>
A lot of "why can't we all work together?" situations cannot be "solved" because of varying technique. This is not untrue of the so-called Lisp curse.
edgar-rft has quit [Quit: Leaving]
kir0ul has joined #lisp
<dbotton_>
I can't see why technically the package name and symbol name can be rename with in a local package
<dbotton_>
can't
amb007 has joined #lisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
<no-defun-allowed>
Well, suppose I managed to rename 'a:foo to 'b:bar. What would (symbol-name <that symbol>) be in packages A, B, and a different package?
<aeth>
As for me, I generally started out using or looking into libraries for various pieces, only later settling on my own approach. e.g. my (very incomplete) approach to shaders is a very different design. It's a separate (and very incomplete, rough draft of a) language instead of trying to compile a subset of CL to GLSL.
<semz>
being notoriously underdocumented despite being idiosyncratic is also a problem with gamedev-related lisp stuff in my experience, especially the FFI parts
<aeth>
no-defun-allowed: you joke about licenses, but this is where the game engine stuff isn't really fragmented. It's almost all MIT license, with a bit of BSD
ex_nihilo has quit [Read error: Connection reset by peer]
<semz>
when using the thing boils down to reading half of its code, many people will just roll their own
<dbotton_>
no-defun-allowed it would be whatever I want in the current package, it is just aliasing the name
ex_nihilo has joined #lisp
<no-defun-allowed>
dbotton_: I fear that would become very inconsistent very quickly.
shka_ has joined #lisp
<Nilby>
dbotton_: because operators, in the sense of special-operator-p or when clhs says [operator] might be compiled into the compiler.
<dbotton_>
if I never use :use then I am always working with longer package names, there maybe occasion to shorten for a single operator
<mfiano>
The underlying fact is that Lisp is more flexible than most other languages, allowing you to shape it to your own mental model. It's no wonder why code is under-documented.
<mfiano>
This also explains why the wheel is often reinvented
<semz>
it does come with the territory a bit, yeah
<dbotton_>
meaning functions/macro in general sense
<mfiano>
It's much easier to rewrite things for your own subset of use-cases than it is to understand someone else's thought processes.
<aeth>
CL is also incredibly multiparadigm.
<Nilby>
Anything being a trivial-X away seems to make me a bit too ambitious.
<aeth>
I've had people assume that my engine is FP or a certain kind of OOP or whatever... just by the language selection. :-)
wxie has quit [Quit: wxie]
<dbotton_>
is there a simple way to duplicate a symbol so two symbols point to same object?
<markasoftware>
what you want is to create a new, distinct symbol with the same symbol-value
<mfiano>
I think you are asking the wrong questions.
anewuser_ has quit [Quit: Leaving]
<markasoftware>
Just do (setf (symbol-value 'my-new-symbol) the-old-symbol)
<markasoftware>
i'm not sure why (setf my-new-symbol the-old-symbol) isn't working for you tbh
<dbotton_>
if a symbol is one function object and now I want another symbol that points to same function object
<markasoftware>
so you're specifically interested in the function part of it?
<dbotton_>
just thinking if easy way to do what I am saying, to access a function in one package from another using a symbol in that second package
<markasoftware>
ah, so there's a name conflict preventing you from importing it?
wxie has joined #lisp
<dbotton_>
no want to shorten the name for a specific function
<mfiano>
There's plenty of ways to do that.
<dbotton_>
that worked
<dbotton_>
so there is a way to rename a specific function or symbol
<dbotton_>
have two symbols now pointing to same closure I made
<mfiano>
Inside your function, you could use symbol-macrolet, define an accessor, point the function cell of a new symbol to that of another. It really depends on the use-case.
bocaneri has joined #lisp
<mfiano>
Symbols are objects, like everything else. They have various "cells" mapping to more than just functions.
<mfiano>
And there are other namespaces too
galex-713 has joined #lisp
<dbotton_>
that is what I thought, nut someone said there was no way to rename a single function
rogersm has joined #lisp
<dbotton_>
so I should be able to make some macros for renaming functions and variables etc
cer0 has quit [Quit: leaving]
<Nilby>
dbotton_: There are actually a things about a function that may not be renamed when you do it that way, for example the documentation, or if it has a compiler-macro-function, etc.
<dbotton_>
so is there a macro of something else that would copy a symbol and all its properties to another symbol
<dbotton_>
so this way all info there
narimiran has joined #lisp
<dbotton_>
and can use for variables or functions etc
<mfiano>
That makes no sense. One such property is the name, and another is the package.
<dbotton_>
obviously leaving out name and package
<mfiano>
Just try inspecting a symbol.
<dbotton_>
everything else would want to transfer over
<mfiano>
Packages and symbols are an integral part of the Lisp parser, so to speak.
<dbotton_>
plists whatever
rogersm has quit [Ping timeout: 240 seconds]
<dbotton_>
ya, and if I want do duplicate a symbol why not? is no difference in some ways from two symbols for same list
<mfiano>
"duplicating a symbol" is impossible, because they are contained in the parser's lookup table known as a package.
<dbotton_>
duplicating its data is
<mfiano>
No, duplicating a subset of its data is. Duplicating it's data is not.
<dbotton_>
I am not duplicating the symbol
bocaneri has quit [Max SendQ exceeded]
bocaneri has joined #lisp
<dbotton_>
ok, so to make a rename-local macro would have to collect all the properties that matter
<dbotton_>
then could in any package rename another packages functions, symbols etc in to the local package
bocaneri has quit [Max SendQ exceeded]
bocaneri has joined #lisp
<dbotton_>
or I am missing something?
bocaneri has quit [Max SendQ exceeded]
<mfiano>
I think you are missing the point of packages and symbols, good protocol design, and how the Lisp parser functions.
<mfiano>
I am out of help for the day.
<no-defun-allowed>
It would become a hassle if you then go to redefine a function or change the binding of a variable.
galex-713 has quit [Quit: No Ping reply in 180 seconds.]
<dbotton_>
good point
<dbotton_>
I was not thinking about the interactive nature of Lisp
<dbotton_>
so you would need complier support
<dbotton_>
or a macro and some table behind it
<beach>
dbotton_: Functions don't have names, so you can't rename them.
<dbotton_>
of course not
<beach>
dbotton_: Just like numbers don't have names.
<wxie>
Is there anybody who has problem to open #emacs channel?
<dbotton_>
I can though rename the symbol point to it
<beach>
dbotton_: No, you can't rename a symbol either.
<markasoftware>
did you try this dbotton_ (setf (fdefinition 'new-symbol) #'old)
<beach>
dbotton_: You can change the binding of a symbol so that it refers to a different object.
<dbotton_>
yes works
<dbotton_>
metioned it
<dbotton_>
merkasoftware I renamed a closure worked perfect with both symbols
<dbotton_>
someone pointed out that some things won't transfer over
<beach>
dbotton_: You can't rename a closure because closures don't have names.
<no-defun-allowed>
I think I've had enough #lisp for today.
<dbotton_>
like the doc string
no-defun-allowed has left #lisp ["User left"]
<dbotton_>
I hope not because of me left :(
<beach>
no-defun-allowed: I understand. I am almost there, and I have only been here for 2 hours.
galex-713 has joined #lisp
<beach>
dbotton_: You keep repeating incorrect phrases, so I wouldn't be surprised.
<dbotton_>
trying to learn the correct idioms and terms, sorry
<beach>
dbotton_: Common Lisp has the concept of "binding" which means that a "name" is associated with an "object".
<dbotton_>
so how would I say properly
<dbotton_>
ok so I want to bind the same object to two symbols
<beach>
That's already better.
<beach>
I think we usually say it the other way around. Two different symbols (or names in general) are bound to the same object.
<beach>
That's what happens when you do (defparameter *a* 234) (defparameter *b* *a*)
<beach>
That doesn't mean that 234 has a name.
<beach>
In the global environment, you can bind function names to functions. A function name is either a symbol or a list (SETF <symbol>).
<dbotton_>
ok, so for a variable
<dbotton_>
a symbol is bound to a number?
<beach>
A symbol can be bound to any object. (defparameter *f* #'car) makes the value of *f* be the function CAR. In this case, the symbol *f* is bound to the function in the variable namespace, as opposed to the function namespace.
<beach>
(setf (fdefinition '*f*) #'car) binds *f* to the function CAR in the function namespace.
<dbotton_>
Just realized forgot there are two namespaces in cl
<beach>
Way more than that.
<beach>
For classes, method combinations, types, etc.
<beach>
Packages.
<mfiano>
In PAIP, it is mentioned that there are at least 7, plus user-defined ones.
<aeth>
e.g. 3.1.1.1 and 3.1.1.3 both have functions, which are obviously the same namespace
<aeth>
the big ones are variables/constants, functions/macros/special-operators, and types/classes
<aeth>
so even if you ignore the niche ones, it's a Lisp-3
<dbotton_>
so to have a second symbol bound to a function can use - (setf (fdefinition 'new-symbol) #'old) and for a second symbol bound to a variable (defparameter)
<mfiano>
beach: 24.1, section "The Seven Name Spaces"
<mfiano>
Yes, pre -CLOS I believe
<beach>
mfiano: Thanks.
<aeth>
oh, anything added by, say, the MOP wouldn't be in the hyperspec, either
<beach>
So, whenever there is a discussion about packages, :USE, slot-value vs accessors, modules etc. it almost always ends up with several people uttering something like "I do <description>" without any further comments. I don't know what to make of that.
<beach>
Sometimes I think it means "I do <description> for which I apologize profusely". Sometimes "I do <description> and that is really great, so I think everyone should do the same". I guess I should be more systematic about asking for clarifications.
<beach>
Like asking "Why do you feel compelled to tell us that?"
<mfiano>
The ones he points out are: 1: functions/macros, 2: variables, 3: special variables, 4: types, 5: tagbody labels, 6: block names, 7: constant symbols inside a quoted expression.
IPmonger has quit [Quit: ZNC 1.7.5+deb4 - https://znc.in]
IPmonger has joined #lisp
<dbotton_>
I just tried (defparameter CL:test "123") so it seems the only way to add a symbol in another package is to first do (in-package)
<aeth>
CL has a package lock on SBCL
<aeth>
but actually, that's because it's not an exported symbol
<dbotton_>
same issue on other packages
<aeth>
(defpackage bar) (defparameter bar::test "123") ; this works, but :: means you're accessing something that's internal to that package
<dbotton_>
the idea was to make a new symbol in a different package
<aeth>
then you'd have to use ::
<aeth>
it's generally frowned upon
<dbotton_>
got it that worked
<dbotton_>
thank you
<dbotton_>
Sorry of my bad Lisp frustrates, working to pronounce things correctly :)
<aeth>
depending on what you're doing (if you're just making the symbol), INTERN could work
<aeth>
(intern "FOO" 'foo) will create a foo::foo
<mfiano>
beach: Often you are one of them, but provide good reasoning, which is also what I happen to follow.
<aeth>
(intern (symbol-name '#:foo) 'foo) ; this is the more defensive way to create foo::foo because your reader might not automatically upcase things, even though it almost certainly does
toorevitimirp has quit [Ping timeout: 260 seconds]
<dbotton_>
great, i'll try making my rename-symbol macro tomorrow, thanks (late for me)
<aeth>
i.e. (symbol-name '#:foo) should produce "FOO" but there's a chance that it produces "foo"
<aeth>
it's called "modern mode" and at least 2 implementations have it
<dbotton_>
beach, appreciate the corrections, thank you
liberliver has joined #lisp
<aeth>
I suppose the most robust way to create a foobar::foo is (intern (symbol-name '#:foo) '#:foobar) to avoid interning a 'foobar to the current package.
<Nilby>
beach: I used to write "I apologize profusely for this pathetic and stupid code" as preface to every module, but I found it wasn't very helpful. Now I write "Bathe in the glory and brillance of this code plucked from jewels of heaven." which seems to work a little better. BUt seriously, Thank You for discussing again the difficult and opinionated subject of naming.
liberliver has quit [Ping timeout: 240 seconds]
<beach>
mfiano: I think I usually give an explanation as to why I think the practice I refer to is good or bad and why I think that.
<beach>
If not, I would like to be told.
<mfiano>
beach: I am talking about those circumventing protocols with SLOT-VALUE/WITH-SLOTS, insisting upon USE-PACKAGE, package granularity decisions, etc. You and I follow very similar practices for writing human-readable/usable/maintainable software. In many years I haven't noticed another developer who cares as much as we do about such things.
orivej has joined #lisp
<beach>
Great!
Kaisyu has joined #lisp
wxie has quit [Ping timeout: 240 seconds]
wxie has joined #lisp
toorevitimirp has joined #lisp
rogersm has joined #lisp
oxum has quit [Remote host closed the connection]
hiroaki has quit [Ping timeout: 260 seconds]
oxum has joined #lisp
narimiran has quit [Ping timeout: 268 seconds]
qhong has joined #lisp
narimiran has joined #lisp
oxum has quit [Ping timeout: 240 seconds]
rogersm has quit []
tiwEllien has joined #lisp
Necktwi has joined #lisp
frost-lab has joined #lisp
IPmonger has quit [Ping timeout: 264 seconds]
IPmonger has joined #lisp
treflip has joined #lisp
random-nick has joined #lisp
IPmonger has quit [Ping timeout: 240 seconds]
gigetoo has joined #lisp
oxum has joined #lisp
hendursa1 has joined #lisp
froggey has quit [Ping timeout: 260 seconds]
IPmonger has joined #lisp
froggey has joined #lisp
hendursaga has quit [Ping timeout: 240 seconds]
pve has joined #lisp
oxum has quit [Ping timeout: 264 seconds]
ndbopoi^ has quit [Ping timeout: 256 seconds]
treflip has quit [Quit: WeeChat 2.6]
ndbopoi^ has joined #lisp
ndbopoi^ has quit [Max SendQ exceeded]
Lord_of_Life has quit [Changing host]
Lord_of_Life has joined #lisp
ndbopoi^ has joined #lisp
ndbopoi^ has quit [Max SendQ exceeded]
ndbopoi^ has joined #lisp
ndbopoi^ has quit [Max SendQ exceeded]
ndbopoi^ has joined #lisp
ndbopoi^ has quit [Max SendQ exceeded]
ndbopoi^ has joined #lisp
ndbopoi^ has quit [Max SendQ exceeded]
ndbopoi^ has joined #lisp
ndbopoi^ has quit [Max SendQ exceeded]
ndbopoi^ has joined #lisp
ndbopoi^ has quit [Max SendQ exceeded]
ndbopoi^ has joined #lisp
ndbopoi^ has quit [Max SendQ exceeded]
ndbopoi^ has joined #lisp
ndbopoi^ has quit [Max SendQ exceeded]
ndbopoi^ has joined #lisp
ndbopoi^ has quit [Max SendQ exceeded]
ndbopoi^ has joined #lisp
ndbopoi^ has quit [Max SendQ exceeded]
ndbopoi^ has joined #lisp
ndbopoi^ has quit [Max SendQ exceeded]
ndbopoi^ has joined #lisp
ndbopoi^ has quit [Max SendQ exceeded]
ndbopoi^ has joined #lisp
ndbopoi^ has quit [Max SendQ exceeded]
liberliver has joined #lisp
liberliver has quit [Ping timeout: 240 seconds]
dbotton_ has quit [Remote host closed the connection]
oxum has joined #lisp
aartaka_d has joined #lisp
skapata has quit [Remote host closed the connection]
aartaka has quit [Ping timeout: 240 seconds]
wxie has quit [Ping timeout: 240 seconds]
Cymew has joined #lisp
elimik31 has joined #lisp
davepdotorg has joined #lisp
davepdotorg has quit [Remote host closed the connection]
fouric has quit [Quit: WeeChat 2.8]
davepdotorg has joined #lisp
hnOsmium0001 has quit [Quit: Connection closed for inactivity]
gaqwas has quit [Remote host closed the connection]
ljavorsk has joined #lisp
wxie has joined #lisp
davepdotorg has quit [Read error: Connection reset by peer]
davepdotorg has joined #lisp
davepdotorg has quit [Ping timeout: 264 seconds]
mmohammadi9812 has quit [Ping timeout: 264 seconds]
wxie has quit [Ping timeout: 268 seconds]
mmohammadi9812 has joined #lisp
dvdmuckle has quit [Ping timeout: 260 seconds]
iissaacc has joined #lisp
liberliver has joined #lisp
benjamin-l has quit [Ping timeout: 240 seconds]
dvdmuckle has joined #lisp
davepdotorg has joined #lisp
davepdotorg has quit [Read error: Connection reset by peer]
davepdotorg has joined #lisp
jesse1010 has joined #lisp
davepdotorg has quit [Read error: Connection reset by peer]
davepdot_ has joined #lisp
davepdot_ has quit [Read error: Connection reset by peer]
davepdotorg has joined #lisp
davepdotorg has quit [Read error: Connection reset by peer]
davepdotorg has joined #lisp
gaqwas has joined #lisp
davepdotorg has quit [Read error: Connection reset by peer]
davepdotorg has joined #lisp
davepdotorg has quit [Read error: Connection reset by peer]
davepdotorg has joined #lisp
benjamin-l has joined #lisp
davepdotorg has quit [Read error: Connection reset by peer]
davepdotorg has joined #lisp
davepdotorg has quit [Read error: Connection reset by peer]
davepdotorg has joined #lisp
elimik31 has quit [Ping timeout: 265 seconds]
space_otter has quit [Remote host closed the connection]
ljavorsk has quit [Ping timeout: 240 seconds]
aaaaaa has quit [Ping timeout: 246 seconds]
mmohammadi9812 has quit [Ping timeout: 264 seconds]
mmohammadi9812 has joined #lisp
froggey has quit [Ping timeout: 240 seconds]
froggey has joined #lisp
mmohammadi9812 has quit [Ping timeout: 246 seconds]
mmohammadi9812 has joined #lisp
saganman has joined #lisp
kir0ul has quit [Ping timeout: 268 seconds]
aartaka has joined #lisp
aartaka_d has quit [Ping timeout: 264 seconds]
aartaka_d has joined #lisp
aartaka has quit [Ping timeout: 268 seconds]
aartaka_d has quit [Ping timeout: 240 seconds]
frgo_ has quit [Remote host closed the connection]
aartaka has joined #lisp
dbotton_ has joined #lisp
aartaka has quit [Read error: Connection reset by peer]
dbotton has quit [Ping timeout: 246 seconds]
aartaka has joined #lisp
luckless has quit [Quit: luckless]
orivej has quit [Ping timeout: 260 seconds]
orivej_ has joined #lisp
ft has quit [Ping timeout: 256 seconds]
Cthulhux` has quit [Quit: ne praeteriverit priusquam obesa cantaverit]
jw4 has quit [Read error: Connection reset by peer]
liberliver has quit [Ping timeout: 264 seconds]
jw4 has joined #lisp
ft has joined #lisp
aartaka has quit [Read error: Connection reset by peer]
frgo has joined #lisp
cosimone has joined #lisp
oxum has quit [Remote host closed the connection]
oxum has joined #lisp
liberliver has joined #lisp
oxum has quit [Ping timeout: 258 seconds]
iissaacc has quit [Ping timeout: 268 seconds]
davepdotorg has quit [Remote host closed the connection]
davepdotorg has joined #lisp
<phoe>
I'd like to say that the primitive control flow operators in Common Lisp are IF, TAGBODY/GO, BLOCK/RETURN-FROM, CATCH/THROW, and UNWIND-PROTECT - all other are derivatives of those
<phoe>
is this true, or did I miss any?
* phoe
is preparing for a tomorrow's talk to the WASM standardization committee about control flow in CL
davepdotorg has quit [Read error: Connection reset by peer]
cosimone has quit [Quit: cosimone]
davepdotorg has joined #lisp
iissaacc has joined #lisp
davepdotorg has quit [Read error: Connection reset by peer]
davepdotorg has joined #lisp
davepdotorg has quit [Read error: Connection reset by peer]
davepdotorg has joined #lisp
<phoe>
clhs 3.1.2.1.2.1 seems to not mention any other special operators strictly for control flow
davepdotorg has quit [Read error: Connection reset by peer]
davepdotorg has joined #lisp
davepdotorg has quit [Ping timeout: 256 seconds]
<flip214>
phoe: what about FUNCALL or APPLY?
<phoe>
flip214: those are related to calling functions and I don't know if I should include them
<phoe>
mostly because FUNCALL is there mostly to support CL being a Lisp-N
<flip214>
well, they change the control flow (dynamically, if the destination is in a variable), and can be used to implement some of the other operators
<phoe>
I don't really want to mention metacircularity in there because catch/block/tagbody can all be implemented via dynavars + funcall
<phoe>
but, yes, that's a good point
Alloc has quit [Read error: Connection reset by peer]
Gerula has quit [Quit: Leaving]
Alloc has joined #lisp
davepdotorg has joined #lisp
aartaka has joined #lisp
davepdotorg has quit [Read error: Connection reset by peer]
davepdotorg has joined #lisp
bitmapper has quit [Quit: Connection closed for inactivity]
davepdotorg has quit [Read error: Connection reset by peer]
davepdotorg has joined #lisp
FreeBirdLjj has joined #lisp
davepdotorg has quit [Read error: Connection reset by peer]
davepdotorg has joined #lisp
davepdotorg has quit [Read error: Connection reset by peer]
davepdotorg has joined #lisp
davepdotorg has quit [Read error: Connection reset by peer]
davepdotorg has joined #lisp
davepdotorg has quit [Read error: Connection reset by peer]
<Xach>
phoe: did you see baker's paper on the topic?
davepdotorg has joined #lisp
FreeBirdLjj has quit [Ping timeout: 260 seconds]
davepdotorg has quit [Read error: Connection reset by peer]
<Xach>
hmm, can't seem to reach his site at the moment
davepdotorg has joined #lisp
davepdotorg has quit [Read error: Connection reset by peer]
<jmercouris>
what if it was (defparameter x (list (list 0) (list 1) (list 2)))
<jdz>
You should probably also join #clschool
<jmercouris>
would it be (append (append (list 0) (list 1) (list 2)))?
<jmercouris>
...
<jmercouris>
no, I really shouldn't
<jmercouris>
just because I don't know every single damn function of the spec doesn't mean I should
<beach>
jmercouris: No, FUNCALL applies a function to a list of arguments.
<beach>
jmercouris: APPLY is more complicated than that.
<jdz>
Why are you bringing DEFPARAMETER into this? A list is a list, no matter where you put it.
<jmercouris>
I am using a defparameter to make things simpler for discussion, we can just refer to X
<beach>
jmercouris: The last argument to APPLY is treated differently from the others.
<jdz>
It feels you're confused (or confusing us) with mixing APPLY and APPEND.
<jmercouris>
I am trying to understand APPLY in this context
<jmercouris>
OK, I clicked through the spec, and I understand now
<jmercouris>
nevermind
<jmercouris>
the description in the CLHS was not helpful
<jmercouris>
"Applies the function to the args. "
<jdz>
If it helps, I'd say: you give APPLY a function and a list, and the function is called with the values in the list. As a bonus you may put extra values that are prepended to the list directly to APPLY.
<jmercouris>
however, "Applies" was a definition with a link in the CLHS
<jmercouris>
and that was helpful
<Xach>
"apply" is something many people learn very very early in their use of learning Lisp, rather than after writing a web browser for a few years.
<jmercouris>
That's a really cool story Xach, do you think you could tell it again?
<Xach>
Keep on clicking. Eventually it will click.
<jdz>
Xach: what about double-clicking? (Sorry, could not resist.)
<Xach>
Structure and Interpretation of Computer Programs has interesting info about what it means to eval and apply. So does Lisp in Small Pieces.
davepdotorg has joined #lisp
<Xach>
jdz: once-only, please
<jmercouris>
you know what is typically good practice?
<jmercouris>
writing tests
<jmercouris>
I believe any self respectable software project should have tests
<Bike>
(apply f (list a b c ...)) = (funcall f a b c ...). is that what you mean by "how does it literally look"?
<jmercouris>
yes, that was my question, I figured it out after clicking through the CLHS
<jmercouris>
thank you Bike for being a good member of the Lisp community
<_death>
jmercouris: conceptually you can think of apply building the argument list and calling the function with it (spread).. so (apply #'append (list (list 0) (list 1) (list 2))) is the same as (append (list 0) (list 1) (list 2))
<Bike>
if you want to know how it works "under the hood", SICP and LiSP are indeed good starting points
<Bike>
but it shouldn't usually matter much to the programmer, unless they're also a compiler developer or whatnot
<jmercouris>
well, I was just wondering
<Bike>
apply also takes a "spreadable" argument list, meaning that (apply f a b (list c d ...)) = (funcall f a b c d ...)
<Bike>
convenient stuff
<jmercouris>
of course that means I should join cl-school
<jmercouris>
where they cover these very beginner friendly topics such as the underlying implementation of apply
<jmercouris>
I believe they in fact teach this in programming 101
<jmercouris>
maybe even to elementary school students
<Bike>
i mean, maybe you should? i don't mean to be rude, but it is surprising to me that you wouldn't understand how apply works given how long i've seen you around here and you've been working on your browser thing
<Bike>
and yes, i know you were being sarcastic just now
<Bike>
but SICP actually does go into these things and is an introductory textbook
<jmercouris>
I don't care to read SICP
<jmercouris>
I am interested only a small amount in implementation details
<Bike>
fair enough
<jmercouris>
and I came to discuss this topic, not to be chastised as if I am an implementation developer
<Bike>
obviously you know how to program, but you have different background knowledge than i'd expect, so answering your questions takes some thought
<Bike>
is all
<jmercouris>
understood
<jmercouris>
I appreciate you, thanks
rpg has joined #lisp
<Bike>
as for how it works at low level, it depends on the implementation of course, but probably somewhat like C's va_args if you're familiar. functions in general are passed an argument count and have access (as a passed argument or stereotypical stack location or something) to memory where arguments beyond the first few go
<Bike>
(details of this page may be out of date, but the argcount is passed in a register, as you can see)
<jmercouris>
I see
<Bike>
then the apply function just takes a list, allocates stack space or whatever, puts the elements of the list there, and calls. APPLY itself probably can't be written without access to implementation internals
<Bike>
which is why it's part of the standard library, obvs
edgar-rft has joined #lisp
oxum_ has joined #lisp
<beach>
Bike: You came up with a good description of jmercouris' knowledge. I am often as baffled as you are, but couldn't figure out a good way of putting it.
<_death>
apply calls the function once, but maybe you thought about reduce, since (reduce #'append (list (list 0) (list 1) (list 2))) would chain the calls like (append (append (list 0) (list 1)) (list 2)) ;; disregarding order of evaluation
ex_nihilo has quit [Read error: Connection reset by peer]
<jmercouris>
_death: that was my motivation for thinking about it, yes
<jmercouris>
which is why you'll see in the very beginning I asked about what it literally does under the hood
<jmercouris>
and offered two versions
<jmercouris>
well, two interpretations of how I thought it might be actually executing
<Xach>
There was an interesting community of people extending GIMP via its scheme-based script-fu extension, and the Scheme code there was essentially "C with funny formatting" in terms of how it used scheme's features and capabilities. people wanted only to manipulate graphics and had no interest in learning about scheme or how it worked. only the bare minimum syntax to make e.g. flaming text.
<_death>
if you want to experiment, you can (defun qappend (&rest args) `(apply ,@args)) and apply/reduce with that function
<Xach>
the code was 90% "foreign" calls into the C core of GIMP, and its C plugins.
<_death>
er, `(append ,@args)
oxum has quit [Ping timeout: 268 seconds]
oxum has joined #lisp
oxum_ has quit [Ping timeout: 264 seconds]
<beach>
Xach: What made you think of that story?
EvW has quit [Ping timeout: 240 seconds]
yitzi has joined #lisp
oxum_ has joined #lisp
oxum has quit [Read error: Connection reset by peer]
<Xach>
beach: I was thinking about the different goals people have when learning to use a tool. Is a single result the most important thing? Is proficiency and skill a goal? Does proficiency and skill and well-rounded knowledge ultimately matter for certain goals? Is there a cultural component to pride in skilled workmanship?
<Xach>
This channel has many enthusiasts who to some degree take pride in skill for skill's sake. How much does that matter in general?
<beach>
Ah, yes, I see. Very interesting questions. And a good analysis of #lisp, which is why I like to hang out here.
<_death>
matters to whom
<Xach>
Also a good question.
<phoe>
I learned Lisp so I could prove my university pals that they're wrong and you can can make money off it and that they should consider me less insane that they did for doing all the Lisp I did
<phoe>
I achieved all of these goals, aside from that last one
<beach>
phoe: Yes, and now you can ask how many books they have published!
<phoe>
actually, that's not really a strictly Lisp-related thing
<jackdaniel>
I think that he could ask many lisp programmers the same thing -- it doesn't make a conclusive evidence that lisp is better ,-)
<phoe>
I've promised myself that my second book will be a fantasy novel
<Xach>
I am interested in woodworking, and though I hate when tech nerds draw too many parallels to their non-tech hobbies, I am reminded a bit of the divide between people who endlessly discuss the cool tools they have acquired or mastered and the people who discuss what they have made regardless of the tool.
ex_nihilo has joined #lisp
<phoe>
;; and, knowing life, I'll get frustrated by something lispy and write another Lisp tech book instead
<Xach>
I enjoy most the output of people who master a wide variety of tools (they are dogmatic about "japanese vs western" or "power vs hand" etc) and pragmatically apply them to achieve interesting results.
<Xach>
are NOT dogmatic, rather
<Xach>
I like the pragmatic aspects of Common Lisp, and also that it seems to be the product of careful, thoughtful engineering to solve pragmatic problems.
<beach>
Xach: I think I have a similar feeling when I see people reject interesting tools like FORMAT, CLOS, LOOP, etc. for dogmatic reasons.
<beach>
"It is not Lisp-y"
<beach>
"I hate object-oriented programming"
Kaisyu has quit [Quit: Connection closed for inactivity]
<jackdaniel>
(or FFI ;)
<Xach>
i am only frightened by FFI, i do not hate it
<beach>
jackdaniel: I don't think I ever said I hate FFI.
<Xach>
but i was also once frightened by a chainsaw and sawmill and now i use them all the time to very fruitful ends, so...maybe it's FFI time!
Alloc has joined #lisp
<jackdaniel>
beach: I'm only joking, and I know that you do not hate it (I also agree, that we should work on native tools)
<beach>
Got it!
shifty has quit [Ping timeout: 240 seconds]
shifty has joined #lisp
<Xach>
i accidentally used the term "domestic code" to contrast with foreign code and i like the sound of it
<beach>
Yes, not bad.
hnOsmium0001 has joined #lisp
frgo has joined #lisp
lucasb has joined #lisp
kir0ul has joined #lisp
frgo_ has quit [Ping timeout: 268 seconds]
dbotton has joined #lisp
<Kabriel>
Sometimes this channel can be a bit edgy, but it might be external influences -- seems like a lot of tension in the world today.
<Kabriel>
There is some difference between, "I just want to do X" and wanting to understand a concept from a more technical perspective.
<Kabriel>
The latter being more aligned with improved craftsmanship.
<Kabriel>
Obviously people here have different goals, but there are a few with different backgrounds, too.
<Kabriel>
I come from an engineering background, although I have done programming in that field the whole time.
<Kabriel>
I find that my questions, especially the initial one, seems on the surface to be basic, because I might be missing a concept (or two) to formulate the question better.
dbotton_ has quit [Ping timeout: 264 seconds]
hendursaga has quit [Ping timeout: 240 seconds]
dbotton_ has joined #lisp
saganman has joined #lisp
hendursaga has joined #lisp
<beach>
Kabriel: I think we usually treat such questions quite well.
<beach>
Incorrect terminology might be corrected, but that's a good thing I think.
dbotton_ has quit [Client Quit]
dbotton has quit [Ping timeout: 268 seconds]
dbotton_ has joined #lisp
dbotton has joined #lisp
gioyik has joined #lisp
<dim>
s/but/and/ I would propose.
Steeve has joined #lisp
<dlowe>
I'm not sure it always is a good thing.
FreeBirdLjj has quit [Remote host closed the connection]
todun has quit [Quit: todun]
<Kabriel>
I like knowing the correct terminology. It helps me learn. And, as mentioned earlier, Bike had a great response.
<jackdaniel>
correction may cause two reactions: 1) person in question learns something, 2) person in question gets angry and leaves; one could argue that it is a very positive filter
<Kabriel>
I was just trying to add to the thoughts Xach brought up
<dlowe>
when someone is starting out, they're going to have valid questions without knowing the terms. Insisting that the question use correct terms is a lot less helpful than answering the presumed question and *then* introducing the terms.
<dlowe>
I don't believe only thick-skinned people have something to contribute.
<Kabriel>
dlowe: my point was starting out with lisp having a good CS education is different than not having that particular background
<dlowe>
Kabriel: sure.
<dbotton>
I personally love being corrected and ergo I love to learn
dbotton has quit [Read error: Connection reset by peer]
dbotton__ has joined #lisp
<dlowe>
If someone asks how to malloc a new object and their only answer is "you don't malloc in lisp, you cons" then even though it's a correction I don't think it's helpful.
<jackdaniel>
I usually give slack to new people, but when someone consistently refuses to learn and reacts with anger to corrections -- that bothers me
Bike has left #lisp [#lisp]
<dlowe>
well, some people are just unreachable, but I would examine my own role before reaching that judgement.
astronavt has joined #lisp
<dbotton_>
dlowe I joice the #clschool channel as but suggested but msgs I send do not go through to it
<dbotton_>
" #clschool :Cannot send to nick/channel"
<dlowe>
dbotton_: probably because you're not registered with nickserv
<dlowe>
dbotton_: we had a big problem with spammers
<dbotton_>
so appologies if too low a level question for here - Is there a list of the #+ compiler directives (and what is the correct nomeclature)? At the moment just need to determine what OS I am on, but can not see to find a list of them any place
<beach>
We allow unregistered people in #lisp?
<dlowe>
dbotton_: #+ looks at the cl:*features* variable
<dlowe>
so you can evaluate that in your repl to view what is there
toorevitimirp has quit [Ping timeout: 264 seconds]
<moon-child>
c.l.l is still alive. Just not very active
* floran
* moon-child
<phoe>
you two are among the wisest of people
EvW has quit [Ping timeout: 240 seconds]
<floran>
thx
<moon-child>
<floran>
haven't used IRC for 20 years or so
oxum has joined #lisp
floran has quit [Quit: ERC (IRC client for Emacs 27.1)]
wsinatra has quit [Ping timeout: 272 seconds]
<phoe>
welcome back!
<Inline>
got the book phoe eheh, just read one chapter or so
<Inline>
thank you
<phoe>
<3
<phoe>
we will be publishing another online appendix soon
<Inline>
why ?
<phoe>
this is because we just realized that the dead-tree version has no hyperlinks whatsoever
<phoe>
not even footnotes, anything
<dlowe>
oh no time for a second edition already
<Inline>
errata ?
<Inline>
oh, footnotes lol
oxum has quit [Ping timeout: 246 seconds]
<Inline>
the C macrology there is mindbending too
<Inline>
fewww
<phoe>
yes, errata - in form of an appendix though, since that'll be much better than just publishing a raw list of links
<Inline>
ok
<phoe>
actually the C macrology is not mine - kudos to the people who have provided me with code and examples
<Inline>
i suppose i'd need a book just for the C preprocessor too
<phoe>
so, Michael, Marco, and Gilbert IIRC
<Inline>
hahahaha
<phoe>
no, seriously, they've improved upon what I originally had and did the same thing over multiple times
<phoe>
dlowe: yes
<phoe>
it's my first book, I don't yet know what to look for :( I thought that the paper version would have physically printed hyperlinks as footnotes, but nope
<dlowe>
well, it's not just your first book, apparently their system has peculiarities
<dlowe>
It's a great book. Don't sweat it :)
<Krystof>
_death: hm, I wonder if I have any copies anywhere
<Krystof>
I'm not sure I believe everything in that any more, mind you :-)
<_death>
I read it some years ago, will need to review
galex-713 has joined #lisp
wsinatra has joined #lisp
benjamin-l has joined #lisp
dbotton_ has quit [Ping timeout: 264 seconds]
galex-713 has quit [Ping timeout: 240 seconds]
dbotton has joined #lisp
EvW has joined #lisp
dbotton__ has quit [Ping timeout: 240 seconds]
dbotton_ has joined #lisp
niceplace has joined #lisp
dbotton has quit [Ping timeout: 264 seconds]
emys has quit [Ping timeout: 260 seconds]
oxum has joined #lisp
shka_ has quit [Ping timeout: 246 seconds]
galex-713 has joined #lisp
emys has joined #lisp
mbomba has quit [Quit: WeeChat 2.9]
emys has quit [Ping timeout: 268 seconds]
emys has joined #lisp
galex-713 has quit [Ping timeout: 264 seconds]
shifty has joined #lisp
aartaka has quit [Ping timeout: 268 seconds]
ex_nihilo has quit [Remote host closed the connection]
ex_nihilo has joined #lisp
niceplaces has joined #lisp
niceplace has quit [Ping timeout: 240 seconds]
Fare has joined #lisp
galex-713 has joined #lisp
<_death>
Krystof: it seems mostly agreeable to me.. maybe with the exception of the advice to avoid pushing at load-time (which 4.1 admits may have disadvantages) and 4.2 (because I agree that testing against versions is bad, that also goes for software-version.. hopefully the operating system provides its own facilities for testing for capabilities/limits/support/whatnot)
aartaka has joined #lisp
oxum has quit [Ping timeout: 264 seconds]
terpri_ has joined #lisp
emys has quit [Ping timeout: 260 seconds]
terpri has quit [Ping timeout: 260 seconds]
terpri has joined #lisp
wsinatra has quit [Quit: WeeChat 2.9]
emys has joined #lisp
terpri_ has quit [Ping timeout: 264 seconds]
orivej_ has quit [Ping timeout: 268 seconds]
<Krystof>
2004-era me was wise
<Krystof>
shame about 2020-era me
Stanley00 has joined #lisp
Stanley00 has quit [Ping timeout: 264 seconds]
<_death>
do you believe the advice in the paper is wrong?
anewuser has joined #lisp
<Krystof>
No, I still generally think that #+reader #+conditional #+stuff (particularly things like "this is an implementation called SBCL" as a proxy for various bits of behaviour) is unwise
<Krystof>
it can sometimes be expedient, but it imposes longer-term costs
anewuser has quit [Disconnected by services]
anewuser_ has joined #lisp
aartaka has quit [Ping timeout: 264 seconds]
<Inline>
the cost of portability
<Inline>
the only cost that a lisper knows of
<Inline>
hahahahahaha
<Inline>
lol
<Krystof>
(implementation behaviour changes over time)
<Krystof>
as for load-time... I think I would tend to suggest an absolute free-for-all of pushing system-specific feature symbols (i.e. those not in CL / KEYWORD packages)
<Krystof>
and probably a blanket ban on pushing CL/KEYWORD symbols at load-time
<Krystof>
agreed that software-type and software-version aren't good enough to test for needed functionality
<Krystof>
anyway. The Common Lisp world's conspicuous lack of taking over the world over the last 16 years is probably not because people are using too many, or too few, reader conditionals
<_death>
heh, I was thinking ~cond (((and :foo :bar) ...) (t ...))