VincentVega has quit [Remote host closed the connection]
<rotateq>
dre: haha yes ^^
dre has quit [Ping timeout: 268 seconds]
random-nick has quit [Ping timeout: 265 seconds]
thomaslewis has joined #commonlisp
dre has joined #commonlisp
thomaslewis has left #commonlisp [#commonlisp]
Guest74 has quit [Quit: Connection closed]
dra_ has joined #commonlisp
dra_ has quit [Client Quit]
dra has quit [Ping timeout: 265 seconds]
Oladon has quit [Quit: Leaving.]
karlosz has joined #commonlisp
tfeb has joined #commonlisp
tfeb has quit [Client Quit]
karlosz has quit [Ping timeout: 240 seconds]
GreaseMonkey has quit [Remote host closed the connection]
karlosz has joined #commonlisp
karlosz_ has joined #commonlisp
karlosz has quit [Ping timeout: 256 seconds]
karlosz_ is now known as karlosz
karlosz_ has joined #commonlisp
lisp123 has joined #commonlisp
karlosz has quit [Ping timeout: 256 seconds]
karlosz_ has quit [Ping timeout: 252 seconds]
lisp123 has quit [Ping timeout: 240 seconds]
karlosz has joined #commonlisp
karlosz has quit [Client Quit]
jeosol has quit [Ping timeout: 252 seconds]
karlosz has joined #commonlisp
karlosz has quit [Client Quit]
Lycurgus has joined #commonlisp
raeda_ has joined #commonlisp
raeda__ has quit [Remote host closed the connection]
karlosz has joined #commonlisp
taiju has quit [Ping timeout: 252 seconds]
Lycurgus has quit [Quit: Exeunt]
poselyqualityles has quit [Ping timeout: 252 seconds]
karlosz has quit [Quit: karlosz]
kennyd has joined #commonlisp
karlosz has joined #commonlisp
peterhil has joined #commonlisp
Guest74 has joined #commonlisp
rotateq has left #commonlisp [ERC (IRC client for Emacs 27.2)]
aeth has quit [Ping timeout: 240 seconds]
aeth has joined #commonlisp
pdietz has joined #commonlisp
abrantesasf has quit [Remote host closed the connection]
pdietz has quit [Ping timeout: 256 seconds]
karlosz has quit [Quit: karlosz]
taiju has joined #commonlisp
dickba___ has joined #commonlisp
dickbar__ has quit [Ping timeout: 240 seconds]
lisp123 has joined #commonlisp
lisp123 has quit [Ping timeout: 252 seconds]
ebrasca has quit [Remote host closed the connection]
Bike has quit [Quit: Lost terminal]
azimut has quit [Remote host closed the connection]
azimut has joined #commonlisp
lisp123 has joined #commonlisp
blihp has joined #commonlisp
<beach>
Good morning everyone!
akoana has joined #commonlisp
z3t0 has quit [Read error: Connection reset by peer]
z3t0 has joined #commonlisp
jeosol has joined #commonlisp
akoana has quit [Quit: leaving]
cjb has quit [Quit: rcirc on GNU Emacs 29.0.50]
lisp123_ has joined #commonlisp
lisp123 has quit [Ping timeout: 256 seconds]
waleee has quit [Quit: WeeChat 3.3]
semz has quit [Ping timeout: 268 seconds]
lisp123_ has quit [Remote host closed the connection]
lisp123 has joined #commonlisp
lisp123 has quit [Remote host closed the connection]
lisp123 has joined #commonlisp
lisp123 has quit [Remote host closed the connection]
semz has joined #commonlisp
<dre>
it's 4pm and i must lisp
<dre>
good morning beach
<pillton>
I think the CLHS entry for REDUCE could be a bit clearer. I don't think I could implement it using the description alone.
<Guest74>
dre: what a wonderful timezone you're in.
<hayley>
Guest74: I agree.
<dre>
here here
<dre>
Guest74, you need a more friendly nick
<dre>
might I suggest GuestSeventyFour ?
igemnace has joined #commonlisp
<beach>
pillton: If you have time, you could create a WSCL "issue" for it.
<pillton>
beach: That is a good idea.
<beach>
That's precisely what WSCL is meant for.
Lord_Nightmare has quit [Read error: Connection reset by peer]
Lord_Nightmare has joined #commonlisp
<Guest74>
dre: it's past midnight here and my thinking is shot. I kept trying to submit the wrong part of my correct answer.
peterhil has quit [Remote host closed the connection]
_73` has quit [Ping timeout: 265 seconds]
karlosz has joined #commonlisp
thomaslewis has joined #commonlisp
tyson2 has quit [Remote host closed the connection]
thomaslewis has left #commonlisp [#commonlisp]
paul0 has joined #commonlisp
greaser|q has joined #commonlisp
greaser|q has quit [Changing host]
greaser|q has joined #commonlisp
greaser|q is now known as GreaseMonkey
karlosz_ has joined #commonlisp
lisp123 has joined #commonlisp
karlosz has quit [Ping timeout: 240 seconds]
lisp123 has quit [Ping timeout: 240 seconds]
karlosz_ has quit [Ping timeout: 252 seconds]
treflip has joined #commonlisp
Guest74 has quit [Ping timeout: 240 seconds]
karlosz has joined #commonlisp
notzmv has quit [Ping timeout: 265 seconds]
blihp has quit [Quit: Leaving]
Nilby has joined #commonlisp
gaqwas has joined #commonlisp
lisp123w has joined #commonlisp
<lisp123w>
What's the best way to implement large (i.e. lots of elements) sets (collections of distinct values)?
<lisp123w>
Hash tables?
<hayley>
I usually use a hash table, yes.
Cymew has joined #commonlisp
<hayley>
Adding an element can just be (setf (gethash table element) t), and then (gethash table element) gives you T or NIL.
<lisp123w>
hayley: Thanks. Do you do anything nifty for set operations like union / intersection etc.?
<hayley>
I'm not sure if there's a good way to handle all the set operations with one data structure efficiently.
<lisp123w>
Yeah, that's what I was feeling too
<lisp123w>
A related question, would there be a considerable performance benefit for using a hash table with EQ vs. EQL vs. EQUAL? (Equal I guess would be considerably slower, but wondering whether to use symbols as keys vs. numbers would help materially)
thomaslewis has joined #commonlisp
shka has joined #commonlisp
thomaslewis has left #commonlisp [#commonlisp]
<hayley>
I would still pick the most specific test.
Algernon69 has joined #commonlisp
<hayley>
Most hash tables are designed so that it is not so common that you have to call the test function on different keys. And EQL should be about as fast for numbers and symbols, so pick the representation you find nicest.
<lisp123w>
hayley: Great, thanks for the info
kennyd has quit [Quit: CGI:IRC (Session timeout)]
frgo has quit [Ping timeout: 252 seconds]
jurov has quit [Ping timeout: 265 seconds]
aartaka has joined #commonlisp
attila_lendvai has joined #commonlisp
pillton` has joined #commonlisp
pillton has quit [Ping timeout: 260 seconds]
amb007 has quit [Ping timeout: 256 seconds]
amb007 has joined #commonlisp
xantoz has quit [Read error: Connection reset by peer]
lisp123 has joined #commonlisp
karlosz has quit [Ping timeout: 240 seconds]
xantoz has joined #commonlisp
lisp123 has quit [Ping timeout: 265 seconds]
dickba___ has quit []
gaqwas has quit [Ping timeout: 265 seconds]
cranium has joined #commonlisp
cage has joined #commonlisp
<pjb>
lisp123w: define "best"
<pjb>
lisp123w: depends also on the kind of element, whether your sets are dense or not.
<pjb>
lisp123w: if you can map your elements to a range of integers, then using bit-vectors to represent those sets is a nice way.Short on memory, efficient (we have bit-operations).
<pjb>
lisp123w: but if your sets are sparse, it may become costly. A more sophisticated representation may be in order.
notzmv has joined #commonlisp
pve has joined #commonlisp
<beach>
lisp123w: There is no such thing as a "set" in computer science. You need to specify the operations on the collection for it to be possible to determine the best representation. For example, if all you need is to add objects and then remove an arbitrary object, then a stack is fine.
<beach>
lisp123w: If your domain admits a total ordering, the best solution might be different than if it does not.
<beach>
lisp123w: If you need to find the "smallest" element, again the representation will be different.
<beach>
lisp123w: If all you need is "union" and "find the set of an element", then again, the solution is different.
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
<beach>
lisp123w: And, as hayley pointed out, if you want all usual set operations, you are basically out of luck. No efficient solution exists.
<beach>
lisp123w: And when you specify the operations that you need, you have a "protocol" for an "abstract data type", which is usually the best way to start.
s-liao has quit [Ping timeout: 256 seconds]
euandreh has quit [Ping timeout: 252 seconds]
perrierjouet has quit [Quit: WeeChat 3.3]
perrierjouet has joined #commonlisp
euandreh has joined #commonlisp
jpl01 has joined #commonlisp
lisp123 has joined #commonlisp
lisp123 has quit [Ping timeout: 252 seconds]
<Nilby>
I'd like number sets that can do (union* #'evenp #'oddp) => #'identity or even (set-difference* #'identity (λ (< _ 5000))) => ( (>= _ 5000) (>= _ 5000)
<Nilby>
or rather (set-difference* #'identity (λ (x) (< x 5000))) => (λ (>= _ 5000))
<semz>
Nilby: Wouldn't that just be (defun union* (f g) (lambda (x) (or (funcall f x) (funcall g x)))), etc? Well, it would result in (constantly t) instead of #'identity, but otherwise I'm not sure what you're looking for.
<semz>
Set operations correspond to logical operations after all.
<beach>
semz: That trick works only if you don't need another operation such as |S|, i.e. the size of the set. And that's just one example.
<beach>
It's a great trick when it works though, and it is at the center of the Haskell solution to the GeoServer problem in the paper by Hudak and Jones.
<Nilby>
I want a union for numbers to be little smarter than just ‘or’. It could of course falll back on that.
<Nilby>
Sort of like what an SQL query optimizer can do.
<beach>
Nilby: OR is very smart. If you don't think so, you need to specify what it is you require as smarter.
<beach>
Let me say this again. It is impossible to determine a good solution to set representations unless all the desired operations are specified.
<beach>
Nilby: In your case, if all you have are the functions, then you are probably out of luck, because you rapidly get into undecidable territory.
<semz>
I suspect it already becomes impossible when one adds set size, but I'd have to check.
<beach>
semz: Using the characteristic functions only, yes.
perrierjouet has quit [Quit: WeeChat 3.3]
<Nilby>
theoretically uncomputable in the general case and impossible are different things
<beach>
Good luck.
<hayley>
One idea which gets bounced around #lispcafe every so often is to have a "profiling" set which changes representation based on what operations are more frequent.
<Nilby>
hayley: That's the kind of thing I'm thinking of. If your set is (zerop (mod (random _) 23))) you might have to use a bitmap, but you could say guess that the count is < 500 for a set of 10k.
Lord_of_Life has joined #commonlisp
<beach>
Nilby: But you didn't say that you have a bitmap. All you showed was the characteristic functions. So your specification is changing, which is what makes all similar discussions frustrating and ultimately futile.
<hayley>
I have a sort of similar issue with character sets in my regular expression engine. I'd like the fastest procedure to test if a character is a member of some set. A set with one element E could be compiled down to (char= character E). A range of characters [A, B] could be (char<= A character B). The union of some ranges is also not too hard. But, if we have too many of those ranges, compiling such a test would result in code bloat, and we had
<hayley>
better use a bitmap.
VincentVega has joined #commonlisp
<hayley>
Oh, and then we want a relatively compact "bitmap", so that it will fit in cache, and so that we don't use too much memory to represent a compiled regular expression. Nitpicking all the way down!
<Nilby>
From my investigations most unicode set things use a combo of hardcoded ranges and hierarchical ranges / trees.
<Nilby>
But I guess a caller supplied set is harder.
<hayley>
And recall that the only operations I care about the performance of (at runtime) is set membership. I mean, a fast compiler is always nice, but it is not necessary to split hairs there.
<Nilby>
hmmm, is bloom filter or something overkill?
<hayley>
We probably do thousands of set operations in the compiler at worst, but we do at least one set operation per character scanned at runtime.
<hayley>
It's not overkill if you can make a fast Bloom filter. My current idea is to use a two-level bitmap, where one vector contains references to smaller bitmaps. We can reuse smaller bitmaps, so #*0000.... and #*1111.... will only exist once in an image.
<pjb>
Nilby: to do something like (union* #'evenp #'oddp) => #'identity you need a system that knows integers. Try ACL2, a theorem/program prover.
<hayley>
So, as pjb mentioned, the distribution of the elements in a set can also affect which representations are appropriate.
<Nilby>
For lisp text stuff I feel like half the speed and space is lost by converting from utf8. I've been eyeing the way python reaches into utf8 without decoding.
pranavats has left #commonlisp [Error from remote client]
<hayley>
From my own experience, you only notice a difference with SIMD. And the difference between Lisp characters and raw bytes is closer to 3× or so.
<hayley>
And, in the context of regular expression matching, you might find yourself having to decode UTF-8 on the fly, either by having the DFA simulator do that for you (introducing more branches), or by encoding UTF-8 characters into the DFA (creating a larger automaton). Having your text already decoded avoids both situations.
pranavats has joined #commonlisp
<Nilby>
pjb: Yes, I know what I was dreaming of goes into the prover zone,
<Nilby>
hayley: That's an interesting idea. Decoding in the engine might even beat other approaches.
<hayley>
Nilby: Most "other approaches" do decode in the engine. I had a short discussion with the author of the Rust regex engine, and he said that decoding in the DFA is quite annoying, and decoding in the simulator makes matching slower.
<Nilby>
I've already read your code, and I think it's quite amazing. It was fun to see you and phantomics on the the front of HN on the same day.
<hayley>
What he didn't tell me was that the engine he wrote attempts to match literal bytes where possible, and then falls back to UTF-8 parsing if the character lengths aren't constant. Or at least that's what I got from reading the source code.
<Nilby>
I can stomach reading C for a little bit but rust code makes me a little queasy.
<hayley>
But you then need to detect when byte matching can be used or not, which introduces more complexity to the compiler. There is also the option to hope that all your input is ASCII, and have UTF-8 processing be a slow path. But that option is too Anglocentric for me, as I solely speak Greek with some of my family.
<hayley>
Nilby: I found it nicer to call PCRE2 and Hyperscan from Rust, admittedly. But the reason for that is due to having to manually check allocation failures and other errors, which C is abnormally terrible with. And 70kLOC of anything is unreadable to me.
<phantomics>
Was April on the front of HN lately?
<hayley>
It might have been around when pne-more-re-nightmare [sic!] was.
<phantomics>
I see that was 5 days ago, don't see anything April-related around that time
<pjb>
Nilby: you can read utf-8 files as binary octet files, since that's what they are. Then keep processing them using octet vectors, not lisp strings!
<pjb>
Nilby: have a look at: com.informatimago.common-lisp.cesarum.ascii ; something similar can be done for utf-8 octet vectors.
<Nilby>
I guess maybe the encoding pre-scan way with SIMD might be faster. greek is in the two byte zone, so no too bad. But everything is littered with 8 byte emojies now.
<hayley>
That said, I would like to do a more Hyperscan-esque version of the compiler, which aggressively pulls apart more string literals and easy to optimise constructs, and then schedules those parts however appropriate.
pillton` has quit [Remote host closed the connection]
<Nilby>
pjb: Yes, I've found that technique is valuable for reading big things, giant CSV files, etc.
<pjb>
Sometimes you can even process files without reading them, just keeping lists of file positions around!
<hayley>
For example, a* could be compiled into a loop which loads a SIMD vector of characters, compares to #\a, and then reports the first character that doesn't match.
<Nilby>
hayley: Like schedules with threads or like with instructions?
<hayley>
With instructions.
<hayley>
One regex I mentioned in the article was [0-9]+x[0-9]+. This regex does not have a string prefix, but it does have...an infix, I guess, of the trigraph [0-9]x[0-9]. In a perfect world, we would scan for that trigraph using an optimised routine, and then search for [0-9]* on either side (and in either direction) to get a full match.
<Nilby>
I don't know SIMD very well. Maybe you could load every digit up into a register? I guess there is a limit to what you can fit.
<Nilby>
like every digit pattern
<hayley>
No, there wouldn't be enough registers. And [0-9]+ matches between one digit and infinitely many digits, so there are definitely not enough registers.
<hayley>
When there is a useful prefix, e.g. when surrounding that regular expression in quotes, I generate the SIMD equivalent of (char<= #\0 char #\9)
<hayley>
I _think_ that is the edge I have over other engines which use SIMD; I can generate optimised code for arbitrary ranges. Whereas, say, I know Rust regex only handles a single character (which isn't a good choice), a single string ("[0-9] denotes a set of 10 strings), or uses a more complex multiple substring matching procedure.
<hayley>
So, I just generate code for (and (char= #\" first-character) (char<= #\0 second-character #\9)) but with SIMD.
<Nilby>
I think there _must_ be an advantage to having the compiler so handy
<hayley>
There is a definite advantage if you have to run a DFA still.
<Nilby>
Before loooking at hyperscan I hadn't thought that people would be doing packet inspection with regexps, but I guess it hard to hand code all that.
<hayley>
Yes, moreso if you have to write a complex state machine or SIMD code. one-more-re-nightmare outperforms a simple hand-written scanner with just scalar code, and blows hand-written code out of the water with SIMD.
<Nilby>
It's exciting that we might have such a fast thing to use soon :)
<hayley>
You can try it out right now, but I would characterise it as a "glass cannon" sort of library.
<hayley>
Some regular expressions generate very large DFAs, which will lead to terribly slow compilation times, but gilberth and I suspect they are rare in practise. We don't know that, still.
jurov has joined #commonlisp
<Nilby>
most poeple don't write "a*a*a*a*a*b"
<hayley>
Oh, I can handle that just fine. The worst case for a DFA compiler, from memory, is something like (a|b)*a(a|b){N} for large N.
<Nilby>
I guess that N can be like a multiplier
<hayley>
I recall that the size of a DFA for that expression is O(2^N).
<Nilby>
You probably know, but some elisp code has some of the worst re's i've seen, if tyou need tests.
<hayley>
"a*a*a*a*a*b" only compiles to a DFA with one more state than "a*b". Currently I don't think I simplify a*a*, but derivatives are smarter than such "tricks" for simpler engines.
<hayley>
I didn't know that, I haven't written much elisp.
<Nilby>
since so much elisp uses re's for language parsing
<hayley>
Sure.
mrcom__ has quit [Quit: Leaving]
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
lisp123 has joined #commonlisp
lisp123 has quit [Ping timeout: 256 seconds]
<Nilby>
the use of trivia makes the code look very natural
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
<hayley>
Yes, I wanted to copy the definitions from the papers as closely as possible, to minimize the risk of subtle transcription errors.
amb007 has quit [Read error: Connection reset by peer]
random-nick has joined #commonlisp
amb007 has joined #commonlisp
<Nilby>
I think even more understandable to me in lisp notation
<hayley>
Quite likely. gilberth wrote some of his notes in postfix. "What's rφ going to do? Oh, right. That's a substitution."
<Nilby>
but see a few symbols in there, using ¬ was very popular in lisp machine days
perrierjouet has joined #commonlisp
<hayley>
Yes, I quite like my compose key. The surface notation for regular expressions was also a compromise betwen how Owens et al presented regexes in their paper, and the usual POSIX syntax.
<hayley>
(For what it's worth, I now know that punning off the name of a song from a relatively popular band does not make you immune to appearing in search results.)
<hayley>
Probably should use a POSIX parser, but I really like having angle brackets for submatches, so that we keep () for changing precedence, rather than using () for submatches and (?:) for just precedence.
<hayley>
() is easier to type than (?:) and it looks less weird to me.
random-nick has quit [Ping timeout: 240 seconds]
<Nilby>
You'd need to add forbidden social/political keywords to really disappear. I think POSIX parser is overrated. There's already like 20 slightly different syntaxes, I use lisp commands instead of POSIX or emacs, so now I only know cl-ppcre's variant.
<lisp123w>
pjb & beach - many thanks, that's very helpful
<hayley>
I was told the PPCRE extensions to POSIX regular expressions are all parse errors for a POSIX parser, but I have never tested that.
<Nilby>
That seems true-ish.
<Nilby>
that explains the (?:)
<hayley>
It's ironic is that the syntax for regular expressions is not regular :)
<hayley>
s/is//
cosimone has joined #commonlisp
<lisp123w>
I was looking at a data structure where there is Integer IDs as keys and then an object as a value. So bit vectors could very useful? I'm mostly looking at set union / intersection / complement so was thinking using numbers as a key might be useful
<Nilby>
the irony is not lost on GNU's not unix or posix or linux or etc.etc.
<hayley>
But there are a few "save the user from themselves" points around RE engines. gilberth mentioned checking which variables are actually used in a scanner action, so as to avoid handling submatches where they are never observed. The Rust library has a special case for submatching where it will defer to the non-submatching path if there are no subgroups in the RE, with a comment like "save the user from themselves".
<lisp123w>
I will definitely start off with a protocol to abstract away the interface (thanks for reminding) and then will have a look at bit vectors. I saw Microsoft did something once where, say items 1 - 15 are populated in a set, they would create a "block" saying [start 1 ; End 15], and then if one is comparing two different sets, its a bit easier because you can compare the blocks and then drill down as necessary
<hayley>
But there is basically no overhead to submatching with this approach, except for more register pressure.
<hayley>
Hm, yes, gilberth gave me an implementation of that structure, called an isum. Apparently McCLIM uses a two dimensional version of it.
<Nilby>
hayley: pointless subgrouping does seem very common in the wild
phantomics has quit [Read error: Connection reset by peer]
<lisp123w>
pdietz: Looks like it. The background of my initial query was that I was lookin at some Swift code and they have sets. The beauty of lisp seems to be its much easier to build custom approaches to data than other languages
<lisp123w>
(at least compared to Swift)
theothornhill has joined #commonlisp
<pdietz>
You might look at the FSET package (available in Quicklisp). It provides implementations and convenient syntax for sets, bags, and maps, and shadows some CL builtin functions with symbols that are fbound to generic functions that default to calling the CL functions. This allows methods to be added for the new collection types, and for new
<pdietz>
collection types to be added.
amb007 has quit [Read error: Connection reset by peer]
<theothornhill>
How would you deal with case sensitivity in lisp? I can do trickery to convert from/to camelCase or PascalCase, but I need to do some inferencing on type names. And in graphql case is important. For example, I want the type
<theothornhill>
'Query' to be that, and not 'QUERY'. Sorry, misclick
amb007 has joined #commonlisp
<theothornhill>
I guess it is possible to have a class called |Dog|, but that is kinda ugly
<lisp123w>
pdietz: Thanks, will check it out.
<pdietz>
I normally just live with CL's conventional approach, and if I want case sensitive symbols I escape them. The CL convention is to use kebab case.
<pdietz>
Not ThisIsAName or thisIsAName or this_is_a_name, but this-is-a-name
<theothornhill>
Ok, so you'd use it as kebab internally in your library, then convert when shipping it as json, etc?
<pdietz>
cl-json has a converter from camel case to "lisp" (i.e., kebab case) and back again, for example.
<pdietz>
Some json libraries for CL just leave things in strings (like jsown); this is often faster.
<pdietz>
The intern function can be annoyingly slow; when I want symbols out from json I found it was faster to use jsown and then write a custom string->symbol convertor for jsown using string-case to handle the common cases for the particular json I was working with.
<pdietz>
string-case plays some interesting games to get really fast code; I wonder if those regular expression libraries could learn a thing or two.
<theothornhill>
pdietz: thanks. I'll see how I can work without dealing with casing, then!
Algernon69 has joined #commonlisp
<pdietz>
To be clear: string-case has nothing to do with the upper or lower case, but rather with case as a switch-like control flow macro.
frodef has joined #commonlisp
<theothornhill>
string-case from alexandria?
tyson2 has joined #commonlisp
<frodef>
Hi all. My sbcl/asdf/quiclisp setup has somehow gone haywire since I tried to add an ~/.config/common-lisp/source-registry.conf
<frodef>
That is, (load "~/quicklisp/setup") results in a 'COMPILE-FILE-ERROR while compiling #<CL-SOURCE-FILE "asdf" "build" "asdf">' that I'm unable to make sense of.
<frodef>
...even after I removed the .conf file completely.
<frodef>
(oh my, have to go, back in an hour or two..)
<pdietz>
No, from string-case. (ql:quickload :string-case)
<Nilby>
frodef: As you may know, the "easy" way, which may induce some long recompiling, is probably to "rm -r ~/.cache/common-lisp" . The harder way is to figure out what went wrong, which is likely some conflict in compiled versions of asdf. Perhaps you ended up with another asdf in you source registry?
<theothornhill>
pdietz: ah ok. Thanks! I'm actually thinking of just requiring for the user to supply a :name along with the types to define. Then that could just be a string, and I can operate more easily with kebab-casing guilt free
theothornhill has quit [Ping timeout: 252 seconds]
attila_lendvai has quit [Ping timeout: 252 seconds]
lisp123 has joined #commonlisp
lisp123 has quit [Ping timeout: 240 seconds]
danirukun[m] has left #commonlisp [#commonlisp]
dpetrovs has joined #commonlisp
OlCe has quit [Ping timeout: 256 seconds]
<frodef>
Nilby: thanks, but I already tried removing the cache, to no apparent effect, even in terms of compilation time. I really don't get it.
<frodef>
Hm.. I was able to trace it, and it seems somehow it's loading/compiling asdf from ~/src/MBuild, which makes no sense. That's just a build system for Mezzano that's randombly lying around. sigh.
<froggey>
make sure it isn't linked from quicklisp's local-projects directory
<frodef>
So.. trying to make my code available for asdf, I'd made a symlink ~/common-lisp to ~/src and then the presence of ~/src/MBuild/ just broke everything.
<frodef>
..and apparently any old library code found anywhere in ~/src will just override (and break) the quicklisp projects, without warning. Seems a bit brittle design to me.
Bike has joined #commonlisp
OlCe` has joined #commonlisp
attila_lendvai has joined #commonlisp
thomaslewis has joined #commonlisp
<cranium>
I guess quicklisp lets you override things by putting them into the ~/quicklisp/local-projects folder (which makes sense imho), and it treats ~/common-lisp the same way (also makes sense).
thomaslewis has left #commonlisp [#commonlisp]
thomaslewis has joined #commonlisp
thomaslewis has left #commonlisp [#commonlisp]
s-liao has joined #commonlisp
<cranium>
What confuses me is that it apparently loads enough of such code at startup to break things? ~/quicklisp/setup does some (re-)loading of asdf, which I guess conflicted with the hierarchy in <https://github.com/froggey/MBuild/tree/master/home>
<cranium>
and then all hell broke loose.
kennyd has joined #commonlisp
waleee has joined #commonlisp
<etimmons>
ASDF attempts to eagerly upgrade itself. So QL probably used the ASDF bundled with your implementation, then when the QL client was loaded (via asdf:load-system), ASDF saw there was a newer version of itself available and tried upgrading
<frodef>
I found the errors and restarts extremely unhelpful, btw.
kennyd has quit [Quit: CGI:IRC (Ping timeout)]
kennyd has joined #commonlisp
lisp123 has joined #commonlisp
Algernon91 has joined #commonlisp
lisp123 has quit [Ping timeout: 256 seconds]
Algernon69 has quit [Ping timeout: 265 seconds]
attila_lendvai has quit [Ping timeout: 240 seconds]
thomaslewis has joined #commonlisp
thomaslewis has left #commonlisp [#commonlisp]
dlowe has joined #commonlisp
cosimone has quit [Remote host closed the connection]
cosimone has joined #commonlisp
pdietz has quit [Ping timeout: 256 seconds]
amb007 has quit [Read error: Connection reset by peer]
VincentV` has joined #commonlisp
VincentVega has quit [Ping timeout: 240 seconds]
amb007 has joined #commonlisp
<mfiano>
How do I parameterize the number 1 in the FORMAT control string "~,1f" ?
<adeht>
(format t "~,VF" 1 1.234)
adeht is now known as _death
<mfiano>
Thanks
jpl01 has quit [Remote host closed the connection]
Guest74 has joined #commonlisp
Cymew has quit [Ping timeout: 240 seconds]
pdietz has joined #commonlisp
s-liao has quit [Quit: Client closed]
Catie has joined #commonlisp
ebrasca has joined #commonlisp
frgo has joined #commonlisp
VincentV` has quit [Ping timeout: 256 seconds]
random-nick has joined #commonlisp
makomo has joined #commonlisp
parjanya has quit [Remote host closed the connection]
cosimone has quit [Remote host closed the connection]
cosimone has joined #commonlisp
waleee has quit [Ping timeout: 252 seconds]
dpetrovs has quit [Ping timeout: 240 seconds]
lisp123 has joined #commonlisp
lisp123 has quit [Ping timeout: 240 seconds]
<xaltsc>
Hey, I'm trying to define and use a package with asdf/quicklisp/sbcl, however, when I load the package, it complains that some variables, used in functions, are not defined, even though they are, some, in the same file, others in other files.
<jackdaniel>
xaltsc: I think that you'll have a better chance for help if you include some possibly shortened source code that illustrates the issue
Devon has quit [Read error: Connection reset by peer]
<cranium>
is it only in this example that there's no (in-package ...) in foo.lisp and bar.lisp?
<dlowe>
xaltsc: in-package forms only affect the file they're in - you need to have it in each
<dlowe>
(the truth is more subtle but the answer is to put in-package forms at the top of your file
<jackdaniel>
that. also you use the variable *bar* which is defined in the file compiled later - it will work but that will give you a warning
<dlowe>
worse, it will *sometimes* do what you want depending on the current package
<xaltsc>
I forgot to include them in this minimal example, but it doesn't change anything. It seems that the order of the components matter though. foo.lisp errors when bar.lisp is defined after, and the converse.
<cranium>
Yes, order does matter and sadly one has to define it manually.
<xaltsc>
ugh
<cranium>
but you also have a circular dependency. I'm not sure if that is smart or what the proper solution is that allows you to have that.
<xaltsc>
I added the circular dependency as an example, in the real project, the one thing that makes it fail is that the package is defined in main.lisp but I load this file last as it is supposed to have access to other files in the project
<xaltsc>
*to other symbols defined in other files
karlosz has joined #commonlisp
yewscion has joined #commonlisp
<jackdaniel>
xaltsc: usual approach is to have a file with packages (defined first)
<jackdaniel>
then you have source code, and then you may have a main file as the last one
<cranium>
oh, that isn't gonna work very well. Package needs to come first, particularly before (in-package ...) calls.
<jackdaniel>
if you have in-package in each file, then your example seems like something that hsould work
<jackdaniel>
but yeah, package needs to be defined before the rest is defined in that package
<cranium>
have a package.lisp file with only the defpackage that gets loaded first (i.e. first element in :components)
taiju has quit [Ping timeout: 252 seconds]
karlosz has quit [Client Quit]
dpetrovs has joined #commonlisp
Devon has joined #commonlisp
<xaltsc>
So, I've added a package.lisp file, now loading the project in the interpreter errors on defconstant s, which it says are being redefined (even though they are not)
<jackdaniel>
xaltsc: I gather that they are strings
<xaltsc>
jackdaniel: alists actually
<jackdaniel>
ah, OK. the thing is that they are not EQL to each other
<jackdaniel>
other implementations let it slide, but sbcl is very scrupulate about that - if you evaluate defconstant twice with an object that is not eql to itself then it will cause an error
<jackdaniel>
there is a reason for that. either way just use defvar (or alexandria:define-constant that allows specifying the test)
<xaltsc>
So SBCL can only define constants for primitive types ?
<cranium>
does the violation also happen if you simply quickload a project twice? i.e. my-package:my-constant gets defined twice so it complains?
<jackdaniel>
no, it can define a constant for any type, but it will refuse to redefine it to another object that is not eql to the former one
hhdave has quit [Ping timeout: 268 seconds]
<jackdaniel>
(i.e if you put a reference to the same object in multiple defconstant forms then there will be no problem)
hhdave has joined #commonlisp
<jackdaniel>
i.e try (defvar *yyy* "zzz") and (defconstant +yyy+ *yyy*) multiple times - that shall work
<jackdaniel>
otoh (defconstant +yyy+ "zzz") multiple times won't
tyson2 has quit [Remote host closed the connection]
even4void has joined #commonlisp
<rotateq>
kennyd: after a little search for job descriptions at omron for "solutions engineer artificial intelligence" the only really concrete thing what to know is "mastery of common microsoft office programs". i find it quite ridiculous, every time i read something like this in such advertisement
<hayley>
jcowan: CL-PPCRE has something similar too, and a S-expression syntax is also in my backlog.
lisp123 has joined #commonlisp
dpetrovs has joined #commonlisp
karlosz has joined #commonlisp
lisp123 has quit [Ping timeout: 265 seconds]
thomaslewis has joined #commonlisp
akoana has joined #commonlisp
thomaslewis has left #commonlisp [#commonlisp]
thomaslewis has joined #commonlisp
thomaslewis has left #commonlisp [#commonlisp]
nature has quit [Ping timeout: 265 seconds]
thomaslewis has joined #commonlisp
thomaslewis has left #commonlisp [#commonlisp]
<jackdaniel>
only artificial intelligence could bear mastering common microsoft office programs before dying of bordeom
<jackdaniel>
so no wonder
<rotateq>
jackdaniel: right, good that you mentioned it, now my viewpoint widened :)
<rotateq>
but when some day finally real AI starts to rise and grow, even they must have the right to say "No, I don't want to use that."
<jackdaniel>
it is enought that corporations want to gain legal personality. but this is offtopic
<rotateq>
yes, i just thought when seeing the video "oh, maybe ontopic when they use CL, like with Roomba"
dpetrovs has quit [Ping timeout: 256 seconds]
x88x88x has quit [Remote host closed the connection]
x88x88x has joined #commonlisp
x88x88x has quit [Remote host closed the connection]
dec0d3r has joined #commonlisp
tyson2 has joined #commonlisp
x88x88x has joined #commonlisp
Guest74 has quit [Quit: Connection closed]
Algernon91 has joined #commonlisp
Algernon666 has joined #commonlisp
Algernon91 has quit [Ping timeout: 252 seconds]
dpetrovs has joined #commonlisp
shka has quit [Ping timeout: 252 seconds]
dpetrovs has quit [Ping timeout: 252 seconds]
peterhil has quit [Read error: Connection reset by peer]
peterhil has joined #commonlisp
cranium has quit [Quit: Leaving]
taiju has joined #commonlisp
aartaka has quit [Ping timeout: 240 seconds]
dpetrovs has joined #commonlisp
notzmv has joined #commonlisp
pillton has joined #commonlisp
peterhil has quit [Remote host closed the connection]
peterhil has joined #commonlisp
peterhil has quit [Max SendQ exceeded]
peterhil has joined #commonlisp
dpetrovs has quit [Ping timeout: 265 seconds]
luis3 has joined #commonlisp
luis has quit [Ping timeout: 252 seconds]
luis3 is now known as luis
thomaslewis has joined #commonlisp
thomaslewis has left #commonlisp [#commonlisp]
dpetrovs has joined #commonlisp
dpetrovs has quit [Ping timeout: 240 seconds]
Oladon has joined #commonlisp
lisp123 has joined #commonlisp
lisp123 has quit [Ping timeout: 252 seconds]
random-nickname has joined #commonlisp
random-nick has quit [Ping timeout: 240 seconds]
gaqwas has quit [Ping timeout: 240 seconds]
Algernon666 has quit [Ping timeout: 252 seconds]
cosimone has quit [Ping timeout: 265 seconds]
Bike has quit [Read error: Connection reset by peer]
dra has joined #commonlisp
ebrasca has quit [Remote host closed the connection]