jackdaniel changed the topic of #lisp to: Common Lisp, the #1=(programmable . #1#) programming language | <http://cliki.net/> <https://irclog.whitequark.org/lisp> <http://ccl.clozure.com/irc-logs/lisp/> | SBCL 1.4.5, CMUCL 21b, ECL 16.1.3, CCL 1.11.5, ABCL 1.5.0
anamorphic has quit [Quit: anamorphic]
pierpal has joined #lisp
anamorphic has joined #lisp
fikka has quit [Ping timeout: 252 seconds]
rumbler31 has quit [Remote host closed the connection]
pierpal has quit [Read error: Connection reset by peer]
robotoad has joined #lisp
anamorphic has quit [Quit: anamorphic]
chipolux has quit [Ping timeout: 245 seconds]
fikka has joined #lisp
nokdoot has joined #lisp
rpg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
chipolux has joined #lisp
mobile_c has joined #lisp
elderK has joined #lisp
<mobile_c> is it true that parsing grammar can be done easily in lisp
<didi> mobile_c: Specially if its lisp.
<didi> it's*
<mobile_c> o.o
<mobile_c> how
<didi> (read)
<mobile_c> ?
<didi> Not _you_ read, but the function READ.
<mobile_c> ._.
<didi> It's that simple.
<didi> Really, I'm not messing with you.
<malice> You're just cheating
<mobile_c> how tf does read parse grammar ._.
<malice> didi lied to you(a bit)
<didi> malice: Indeed, I'm using lisp.
<didi> I did not.
<malice> by lisp he meant Common Lisp
<didi> Indeed.
<elderK> mobile_c: Read itself converts the characters and stuff into a tree of lists and things. READ is fundamental.
<malice> (read) won't parse Scheme
<elderK> If you're used to parsing like, things from another language like C, you will have to roll that mechanism yourself.
<malice> (read) will accept Common Lisp code though
<elderK> And like they say, this only parses Lisp.
<malice> Is it easy to parse any grammar though?
Mr-Potter has quit [Ping timeout: 264 seconds]
<malice> What would you use for that?
<mobile_c> how can i parse something like this https://paste.pound-python.org/show/K4QGpELlMYw0VWUjbl37/ using lisp
<elderK> mobile_c: If you'd like to learn about how the reader works, you can find out here: http://clhs.lisp.se/Body/02_.htm
<didi> I think we are dismissing READ too quickly. It's amazing that we can do it. We should praise it more.
<aeth> mobile_c: (loop :for line := (read-line file) :while line :do ...)
<elderK> didi: I agree :) And it's very flexible :D
<aeth> mobile_c: You could also do it character-by-character, but that's harder
<malice> mobile_c: why do you want to parse it? what is your expected return value?
<aeth> oh sorry, it's (read-line file nil)
<elderK> mobile_c: To parse something like that, you'll probably do a lot of stuff you're used to doing in other languages if you've parsed by hand. Or, you can learn to use one of the many parser-generator libraries available for Lisp.
<malice> mobile_c: also are there any properties that you'd expect your parser to have?
<mobile_c> as i want to parse it like a parser grammar (since technically at the moment it is very similar to one)
<mobile_c> eg REG = 0000|0001|0002
<mobile_c> REG
pierpal has joined #lisp
<malice> With problem definition like this, I'd take a look at parser generators: https://www.cliki.net/parser%20generator
robdog has joined #lisp
<mobile_c> as the main problem is figuring how how to parse it like a rule definition/rule expamsion
<mobile_c> or rather implement rule definition and rule expansion and identification
<malice> ?
<mobile_c> identification and expansion*
<elderK> mobile_c: If you want to do it by hand, you could just write a simple lexer and recursive descent parser :)
<elderK> But like malice said, check out the libraries.
<mobile_c> as at the moment im parsing it using a parser
<malice> (also note that the site could use updating; some of the entries are 404 and there are probaly a couple of new ones not listed)
<malice> mobile_c: I'm afraid I don't understand the problem well enough to suggest an optimal solution. One of the things I do not understand is the need for Lisp parser
pierpal has quit [Read error: Connection reset by peer]
<malice> but that might be just curiosity
pierpal has joined #lisp
<malice> then I do not understand the goal - do we want any parser, some specific parser, what representation of AST should we produce, how do we handle the errors, etc.
<mobile_c> idk, a friend said this would be easy with lisp
rpg has joined #lisp
<malice> you can ask your friend! ;)
SaganMan has joined #lisp
<malice> although writing your own parser won't be much different from other languages, I guess.
<malice> also wow, the parser generator section sucks
<malice> half of the links are dead
<malice> and no really great solutions there
<rpg> malice: are you looking at cliki?
<malice> yes
<malice> rpg: I pasted the link few lines above
pierpal has quit [Read error: Connection reset by peer]
<aeth> keep in mind that cliki is probably 15 years old, and not as popular as random github pages like https://github.com/CodyReichert/awesome-cl these days
<aeth> So it will be somewhat stale
<rpg> malice: just re-logged in
<malice> rpg: sure. I meant this page: https://www.cliki.net/parser%20generator
<malice> aeth: good note. I also keep forgetting about those random github pages
<rpg> I've used cl-yacc -- it wasn't a great experience.
<rpg> Not horrible, but not great.
rocx has joined #lisp
<malice> mobile_c: there's also rdp generator here: http://www.informatimago.com/develop/lisp/index.html
elfmacs has joined #lisp
<aeth> if it's on informatimago it's probably AGPL so keep that in mind
igemnace has quit [Quit: WeeChat 2.3]
pierpal has joined #lisp
pierpal has quit [Read error: Connection reset by peer]
<elderK> Guys, what is a good way to test reader macros?
<elderK> Like, to check they correctly expand to what I expect? :)
mejja has quit [Quit: mejja]
<rocx> what all would you use a reader macro for?
<didi> Lambdas! #L(if (oddp _) (1+ _) _)
<elderK> I'm writing a basic quasiquote expander for learning purposes.
<elderK> So I want to have my own "short terms" for ` and , and ,@
<elderK> So that they hook into my expander, rather than the CL one.
<elderK> As far as I am aware, I can't really macro-expand a reader macro?
pierpal has joined #lisp
<aeth> What happens if you put a ' in front of a reader macro?
<elderK> Nothing?
<elderK> Like, '`a gives an error :)
<aeth> strange
<aeth> For read-eval you can do this: '#.(list 1 (list 2 3) 3)
<elderK> My bad, REPL, `'a works
<elderK> Gives me `a
shifty has joined #lisp
<aeth> I think that for a reader macro as long as it returns (turns into?) one thing you can just quote it, but I could be wrongly generalizing from read-eval.
pierpal has quit [Read error: Connection reset by peer]
arescorpio has joined #lisp
rpg has quit [Quit: Textual IRC Client: www.textualapp.com]
frodef has quit [Ping timeout: 268 seconds]
pierpal has joined #lisp
rocx has quit [Ping timeout: 250 seconds]
pierpal has quit [Ping timeout: 268 seconds]
edgar-rft has joined #lisp
warweasle has joined #lisp
pierpal has joined #lisp
masterdonx has quit [Ping timeout: 245 seconds]
nicball has joined #lisp
spacepluk has quit [Ping timeout: 245 seconds]
jebes has quit [Ping timeout: 245 seconds]
dacoda has quit [Ping timeout: 250 seconds]
spacepluk has joined #lisp
masterdonx has joined #lisp
jebes has joined #lisp
nicball has quit [Remote host closed the connection]
esrse has joined #lisp
pierpal has quit [Ping timeout: 252 seconds]
nirved has quit [Ping timeout: 252 seconds]
ryan_vw has quit [Ping timeout: 246 seconds]
nicball has joined #lisp
robotoad has quit [Quit: robotoad]
matzy_ has joined #lisp
antonv has joined #lisp
<antonv> I have a dilemma
chens has joined #lisp
<antonv> a library (an ASDf system) shoudl chose a dependency (another ASDF system) based on what OS / distro it runs on
<antonv> simply speaking, depending on OpenSSL version installed, we should choose an FFI wrapper to load
dddddd has quit [Remote host closed the connection]
<antonv> HHow to describe that in ASDF?
robotoad has joined #lisp
smokeink has joined #lisp
blt has quit [Quit: ZNC 1.7.1 - https://znc.in]
<elderK> thanks aeth
blt has joined #lisp
aeth has quit [Quit: Reconnecting]
aeth has joined #lisp
saturn2 has quit [Ping timeout: 245 seconds]
saturn2 has joined #lisp
angavrilov_ has quit [Remote host closed the connection]
angavrilov_ has joined #lisp
antonv has quit [Read error: Connection reset by peer]
nicball has quit [Remote host closed the connection]
arescorpio has quit [Quit: Leaving.]
sz0 has quit [Quit: Connection closed for inactivity]
nicball has joined #lisp
pillton has joined #lisp
vlatkoB has joined #lisp
igemnace has joined #lisp
nicball has quit [Ping timeout: 245 seconds]
<fiddlerwoaroof> antonv: (:component "foo" :if-feature :darwin)
<fiddlerwoaroof> however, if it's something like "which openssl version is installed", you might have to do a bit of work to get the features setup appropriately.
<fiddlerwoaroof> ... I guess he's left
<fiddlerwoaroof> minion: memo for antonv: (:component "foo" :if-feature :darwin)
<minion> Remembered. I'll tell antonv when he/she/it next speaks.
nicball has joined #lisp
pierpal has joined #lisp
dacoda has joined #lisp
vlatkoB has quit [Remote host closed the connection]
vlatkoB has joined #lisp
vlatkoB has quit [Remote host closed the connection]
vlatkoB has joined #lisp
xkapastel has quit [Quit: Connection closed for inactivity]
smokeink has quit [Remote host closed the connection]
vlatkoB has quit [Remote host closed the connection]
smokeink has joined #lisp
elfmacs has quit [Ping timeout: 252 seconds]
SaganMan has quit [Quit: WeeChat 1.6]
vlatkoB has joined #lisp
pierpal has quit [Read error: Connection reset by peer]
nicball has quit [Remote host closed the connection]
pierpal has joined #lisp
pierpal has quit [Read error: Connection reset by peer]
vlatkoB has quit [Remote host closed the connection]
pierpal has joined #lisp
Roy_Fokker has quit [Read error: Connection reset by peer]
pierpal has quit [Read error: Connection reset by peer]
mobile_c has quit [Quit: Konversation terminated!]
vlatkoB has joined #lisp
pierpal has joined #lisp
pierpal has quit [Read error: Connection reset by peer]
impulse has joined #lisp
dale has quit [Quit: dale]
pierpal has joined #lisp
pierpal has quit [Read error: Connection reset by peer]
pierpal has joined #lisp
pierpal has quit [Read error: Connection reset by peer]
pierpal has joined #lisp
didi has quit [Ping timeout: 244 seconds]
orivej has quit [Ping timeout: 268 seconds]
pierpal has quit [Ping timeout: 268 seconds]
pierpal has joined #lisp
pierpal has quit [Read error: Connection reset by peer]
pierpal has joined #lisp
CrazyEddy has joined #lisp
ryan_vw has joined #lisp
ak5 has joined #lisp
pierpal has quit [Ping timeout: 272 seconds]
shka_ has joined #lisp
<shka_> good morning
pierpal has joined #lisp
Inline has quit [Quit: Leaving]
resttime has quit [Quit: resttime]
dale has joined #lisp
<elderK> Moin shka_
malice has quit [Ping timeout: 256 seconds]
<LdBeth> Good evening
jetchisel has joined #lisp
ak5 has quit [Ping timeout: 240 seconds]
fiddlerwoaroof is now known as hhgbot
hhgbot is now known as fiddlerwoaroof
jack_rabbit has joined #lisp
sauvin has joined #lisp
hhgbot has joined #lisp
hhgbot has quit [Client Quit]
frodef has joined #lisp
ryan_vw has quit [Ping timeout: 245 seconds]
ak5 has joined #lisp
jetchisel has quit [Ping timeout: 272 seconds]
ak5 has quit [Ping timeout: 272 seconds]
frgo has quit [Remote host closed the connection]
jfrancis_ has joined #lisp
JohnMS_WORK has joined #lisp
dacoda has quit [Ping timeout: 276 seconds]
igemnace has quit [Ping timeout: 246 seconds]
figurelisp has joined #lisp
SaganMan has joined #lisp
elfmacs has joined #lisp
ryan_vw has joined #lisp
shka_ has quit [Ping timeout: 252 seconds]
makomo has quit [Ping timeout: 240 seconds]
igemnace has joined #lisp
ryan_vw has quit [Ping timeout: 240 seconds]
robotoad has quit [Quit: robotoad]
frgo has joined #lisp
Zaab1t has joined #lisp
dale has quit [Quit: dale]
graftin has joined #lisp
beach has joined #lisp
graftin has left #lisp [#lisp]
nirved has joined #lisp
<beach> Good morning everyone!
shrdlu68 has joined #lisp
varjag has joined #lisp
solyd has quit [Quit: solyd]
<esrse> good morning
scymtym has joined #lisp
<beach> esrse: Are you new here? I don't recognize your nick.
<shka__> beach: tell me if you have shorcut in emacs to say exactly the above? ;-)
figurelisp has quit [Ping timeout: 268 seconds]
<beach> Heh. I do not. Maybe I should.
<shka__> :-)
heisig_ has quit [Quit: Leaving]
heisig has joined #lisp
<fiddlerwoaroof> morning beach
pillton has quit [Remote host closed the connection]
jochens has joined #lisp
hhdave has joined #lisp
yvy has joined #lisp
hhdave_ has joined #lisp
hhdave has quit [Ping timeout: 268 seconds]
hhdave_ is now known as hhdave
frodef has quit [Ping timeout: 252 seconds]
orivej has joined #lisp
solyd has joined #lisp
jetchisel has joined #lisp
iAmDecim has joined #lisp
chens has quit [Remote host closed the connection]
figurelisp has joined #lisp
pierpal has quit [Ping timeout: 244 seconds]
pierpal has joined #lisp
<p_l> 'morning
pierpal has quit [Quit: Poof]
pierpal has joined #lisp
jdz has quit [Ping timeout: 244 seconds]
Mr-Potter has joined #lisp
fikka has quit [Ping timeout: 240 seconds]
<beach> Hello p_l.
<ogamita> elderK: to test reader macros easily, you can use read-from-string: (read-from-string "`(foo \"string\" ,x)") #| --> (list* 'foo (list* "string" (list x))) ; 18 |# be sure to escape double-quotes and backslashes!
wigust has joined #lisp
<ogamita> aeth: when you prefix a reader macro by a quote, this prevents what is read to be evaluated. So it should print what has been read. Unfortunately, the pretty printer, and even the printer, will often print some objects in a special way. For example: (prin1-to-string '(function foo)) #| --> "#'foo" |# instead of printing as a normal (function foo) list. You can use your own printing function to avoid this caveat, eg. (print-conses
<ogamita> '(function foo)) #| (function . (foo . ())) --> #'foo |# ; notice how the result after --> is printed by cl:print.
Mr-Potter has quit [Ping timeout: 252 seconds]
smokeink has quit [Remote host closed the connection]
smokeink has joined #lisp
<elderK> ogamita: Hey! Thanks! I discovered that on my own ;)
<elderK> * :)
elfmacs has quit [Ping timeout: 252 seconds]
esrse has quit [Ping timeout: 264 seconds]
<ogamita> elderK: another trick when you are developping a reader macro is to use 'my-reader-macro instead of #'my-reader-macro in set-macro-character or set-dispatch-macro-character.
<ogamita> elderK: with ' when you redefine the reader macro, it's taken into account immediately.
fikka has joined #lisp
beach has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
frgo has quit [Remote host closed the connection]
frgo has joined #lisp
nokdoott has joined #lisp
nokdoott has quit [Read error: Connection reset by peer]
robdog_ has joined #lisp
nokdoot has quit [Ping timeout: 264 seconds]
frgo has quit [Ping timeout: 246 seconds]
themsay has joined #lisp
igemnace has quit [Quit: WeeChat 2.3]
themsay has quit [Ping timeout: 244 seconds]
<elderK> Ah nice, so the symbol my-reader-macro is coerced to a function?
<elderK> symbol-function is called, is that it?
themsay has joined #lisp
<no-defun-allowed> Yep.
<no-defun-allowed> The symbol adds redirection so the name is looked up during a funcall instead of being handed the old function object.
<ogamita> it's used with apply or funcall, so a symbol denotes the global function of same name. (actually, symbol-function is used).
m00natic has joined #lisp
frgo has joined #lisp
<elderK> Handy :)
<elderK> Is there any particular reason to say #'name rather than just 'name for say, apply or reduce or whatever?
<jackdaniel> elderK: if you have (flet ((name () "foo")) …) then 'name will refer to a global function definition, while #'name will refer to the local one
<jackdaniel> also #'foo gives you a function itself, so if you (let ((foo #'foo)) (loop (funcall foo))), it will always call the same function when looping (even if you redefine it in a different thread)
frgo has quit [Ping timeout: 245 seconds]
<elderK> jackdaniel: Thanks :) That's good info :)
frodef has joined #lisp
frgo has joined #lisp
fikka has quit [Ping timeout: 245 seconds]
SaganMan has quit [Ping timeout: 268 seconds]
jmercouris has joined #lisp
<jmercouris> how might I go by sorting a list of strings alphabetically?
<elderK> :D make a higher order sort function that accepts an ordering predicate? :D
<jmercouris> I'm not looking to reinvent the wheel
<jmercouris> I'm sure this has been done before
<elderK> I guess you might want to look at Alexandria. Maybe it includes a sorting function.
<elderK> Also, HI jmercouris! :)
<jmercouris> elderK: hello!
<jmercouris> I did look in Alexandria, its possible I missed something though
anewuser has joined #lisp
xkapastel has joined #lisp
<jackdaniel> try this:
<jackdaniel> (sort (list "abc" "aab" "cab" "baa")
<jackdaniel> #'(lambda (seq1 seq2)
<jackdaniel> (uiop:lexicographic< #'char<
<jackdaniel> (coerce seq1 'list)
<jackdaniel> (coerce seq2 'list))))
<jackdaniel> you probably want to replace lambda and uiop piggyback with your own function working on strings
SaganMan has joined #lisp
themsay has quit [Ping timeout: 252 seconds]
themsay has joined #lisp
<elderK> I should've known it was in the language :)
<elderK> jmercouris: You might want to check out Zeal
<elderK> It's a documentation viewer but like, super-searchable.
<elderK> It's made grappling with the CLHS much easier for me.
<elderK> Searching lisp:sort for instance, shows sort and stable-sort in the CLHS :)
<elderK> If you have trouble like, navigating the CLHS as it is online, Zeal could really help :)
<jmercouris> elderK: UIOP is not part of the language
<elderK> sort is
<elderK> And so is stable-sort.
<jmercouris> I navigate the CLHS locally, and UIOP is not at all aprt of the language
<jmercouris> not even "sort of"
<jmercouris> jackdaniel: thanks, I didn't know about uiop:lexicographic!
<jmercouris> very useful!
<jmercouris> I know about sort, did know how to write the predicate to compare two strings and see which one has alphabetical precedence
<jmercouris> s/did/didn't
<White_Flame> (sort list #'string<=)
fikka has joined #lisp
<elderK> White_Flame: Is that case sensitive?
<jmercouris> even better!
lavaflow has quit [Read error: Connection reset by peer]
<jmercouris> I wonder, why does uiop:lexicographic exist then?
* jackdaniel is embarassed now :) 1+ White_Flame
<White_Flame> clhs string<=
<jmercouris> is string<= platform dependent?
<jmercouris> I can't think of why else fare would include such a function in uiop
<jackdaniel> jmercouris: lexicographic in uiop is there for lists, that's why I did coerce them
<White_Flame> there are some forms that ignore case
<jackdaniel> i.e versions (1 2 23) (1 4 14)
lavaflow has joined #lisp
<jmercouris> I see
* elderK nods
<White_Flame> elderK: string< is case sensitive, string-lessp is case insensitive
<elderK> White_Flame: Thanks :)
zmv has joined #lisp
<elderK> Just like char= vs char-equalp
akovalenko has joined #lisp
arbv has quit [Quit: ZNC - https://znc.in]
jetchisel has quit [Quit: Unfortunately time is always against us -- [Morpheus]]
<White_Flame> the inequality tests are based on char< etc, which do defer to implementation specifics
<jmercouris> indeed, so implementation specifc, that is okay for my use case though
notzmv has quit [Ping timeout: 246 seconds]
arbv has joined #lisp
<elderK> jmercouris: string<= doesn't seem to be implementation-specific. Although I guess like, if you like, want to compare unicode strings in an ASCII-only Lisp, I guess would hit trouble.
sunset_NOVA has joined #lisp
<White_Flame> it relies on character codes, which used to not be very standardized, and thus implementation specific
<White_Flame> but now with unicode, they'll tend to be compared by unicode codes
iAmDecim has quit [Ping timeout: 276 seconds]
<White_Flame> but technically free to declare whatever codes they want
<White_Flame> (with a few constraints on a..z, A..Z, 0..9, etc)
<White_Flame> constraints on their relative order, not on their specific code
jetchisel has joined #lisp
<elderK> White_Flame: Right, so it's "super portable" only if you stick to like, the "standard ASCII" stuff, right?
vlatkoB has quit [Remote host closed the connection]
<White_Flame> if you're on modern platforms, you'll tend to be okay
<elderK> As soon as you say, have any kind of international characters - you need to either use an implementation that supports Unicode for its stuff, or implement your own predicates, right?
<elderK> Say, if you were adding unicode support to a CL that didn't support it natively.
<White_Flame> all the major CL implementations support unicode natively, afaik
vlatkoB has joined #lisp
zmv is now known as notzmv
<White_Flame> if they didn't, I dont' believe you'd be able to use character types to represent unicode characters. (but I wouldn't bet my life on it)
<White_Flame> ah, there's CHAR-CODE-LIMIT, which things will refuse to work with if you go outside fo
vlatkoB has quit [Remote host closed the connection]
<elderK> White_Flame: Right. So, much like in other languages that don't natively support Unicode strings, you'd have to implement your own stuff.
nowhere_man has quit [Ping timeout: 252 seconds]
<elderK> That's no major issue though. At least, not if you just want codepoints. Unicode, while annoying, is easy enough to decode.
<elderK> :P It's the other stuff to do with it that is hard.
vlatkoB has joined #lisp
<elderK> Like, normalization or mapping between cases and stuff.
<elderK> Thanks for the info, White_Flame.
<Bike> you could use flexi streams or the like to manipulate things to some extent, if there were no characters past ascii or anything. it would suck though.
jetchisel has quit [Ping timeout: 250 seconds]
<elderK> Bike: How do you mean? :) I'm unfamiliar with flexi-streams.
<elderK> I imagine as long as you can read binary, you can read Unicode. Just to varying degrees of "annoying."
<elderK> :)
<Bike> well, right, it takes care of that. but you wouldn't be able to manipulate the result as lisp strings.
<elderK> How would you add support if you so wanted? Would you have to go as far as creating like, your own types and predicates and everything?
<Bike> you'd have to redo a lot of the standard library. it would be silly.
<Bike> the set of characters is determined by the implementation and can't be extended by users.
<elderK> I guess you would. Maybe implement a code-point type, create predicates for that, then define "unicode strings" on that.
* elderK nods
<White_Flame> basically, dig into the implementation and send a pull request when you're done :-P
<elderK> It kind of seems like an oversight, not allowing some way for users to extend this.
<elderK> I guess it makes sense. But, still.
<jmercouris> Oversight? not extendable?
<White_Flame> it was defined by the OS platform in the past
<jmercouris> are we talking about the same language?
<elderK> jmercouris: As far as I am concerned, at least compared to the languages I usually deal with, CL is pretty well built and is quite flexible.
<elderK> So yeah, to me, it seems like a surprising oversight.
<elderK> Then again, it does not surprise me.
<jmercouris> maybe I'm just in an argumentative mood, but it doesn't seem like an oversight to me
<elderK> Taken in context, it doesn't. I mean, shit, C's support for strings of any kind is kind of crap :P
<elderK> It doesn't support Unicode that well either unless you roll your own abstractions.
<elderK> And White_Flame is right: Back then, well, it was by the platform. Maybe you had code-pages or something, maybe not.
<elderK> So perhaps you're right, jmercouris.
<elderK> Maybe it only seems like an oversight in hindsight :D
<White_Flame> and as Bike listed, this decision on what the character encoding is is wound up in all sorts of ways in character & string handling
<jmercouris> hindsight is always 20/20 and, as far as I understand, it is mostly up to the implementation to decide
<jackdaniel> for instance extending valid character set would require implementations to allow specializing stream encoders and decoders
<jmercouris> which makes it hardly something the language design imposes upon its usage
<jackdaniel> and that would requier standarizing a lot of things which are not
<White_Flame> the ability to define new character code ranges would mess with the low level byte representation of internal characters/strings, which is beyond the recompilation sensibilities of the day
<elderK> True.
<elderK> Still, I guess it only really matters if you're reading stuff that you intend to evaluate or something anyway, right?
<elderK> If it's just program data you're moving around, it's not really an issue.
<elderK> Like, if it's just strictly read in, do stuff, write out. You can deal with Unicode yourself.
<jmercouris> I am evaluating things with this data, so it is a bit of a problem for me ;)
<White_Flame> anyting you specifically want as a character or string would require the characters' codes to be within range
<jackdaniel> elderK: you have arrays for that
<elderK> jackdaniel: Yeah, exactly what I'm speaking about.
<jmercouris> I mean, the range is pretty high, it's a massive number
<jmercouris> I think it was 1 million something on SBCL on MacOS
<elderK> Well, that AFAIK is roughly the Unicode cap at current.
<elderK> 0x10ff00 or something like that?
<White_Flame> 10ffff
<jmercouris> if we would just remove emojis, I'm sure we could drop that number tremendously
<elderK> Around about that area.
<White_Flame> which is 1,114,111 dec
<elderK> White_Flame: You got it! :)
<White_Flame> jmercouris: I concur and wish to subscribe to your newsletter
<jmercouris> :D
<White_Flame> but in actuality that char code limit was established long before the emoji craze
<elderK> But still, just to get an answer: It is really an issue if and only if you're actually say, relying on CL's native string stuff, right? If you aren't say, intending on having the user give you stuff to read-from-string, or if you aren't reading "text streams", it's not really an issue, right?
<White_Flame> again, anything you specifically want as a character or string type in the runtime at some point would require the characters' codes to be within range
<elderK> jmercouris: I too see little point in emojis being in Unicode
<White_Flame> if you're reading from a byte stream, it will decode in whatever ways it supports
<jackdaniel> while emoji does seems silly at first sight, adding pictograms to unicode doesn't anymore
dddddd has joined #lisp
<jackdaniel> also 1644 characters isn't a big number
<White_Flame> it might even decode those bytes into something character-like
<White_Flame> although maybe not what you want
<jmercouris> emoji seems silly even at second, or third glance
<jmercouris> its been a few years now, and I am still not happy about it
<jmercouris> the only outcome has been people putting poop emojis in their github readmes
<jmercouris> because that's somehow hilarious
<White_Flame> emoji is not creating a record of existing glyphs, it's inventing new ones for the purpose
<jackdaniel> jmercouris: you don't see any utility in simple pictograms being part of the charaset?
<elderK> White_Flame: I mean like, if you're reading as binary, not as text, straight bytes. Uninterpreted or altered. And you, yourself, perform decoding and implemenet your own predicates, etc. As long as you aren't then saying: Yo, CL, read this <bunch or raw stuff>, it's not going to matter.
jfrancis_ has quit [Ping timeout: 268 seconds]
<jmercouris> jackdaniel: no, they just irritate me
<White_Flame> READ this is going to require the ability for it to be characters
<elderK> jackdaniel: I would rather useful pictograms be added. Not things like poop or cats.
<jackdaniel> such "signs" are universally recognizable disregarding written language knowledge
<elderK> White_Flame: Right. So, I'm saying if that isn't necessary and you aren't using string<= and stuff, then not having native Unicode support is not necessarily a killer.
<White_Flame> and unicode still doesn't have petscii or klingon
<White_Flame> (last I checked)
frgo has quit [Remote host closed the connection]
<White_Flame> elderK: depends on what you mean by "killer". It means you can't use any string, character, READ, etc utilities
<jmercouris> jackdaniel: ok, that's a pretty convincing argument actually, however let's say I disagree about WHICH emojis are necessary or not
<White_Flame> it would probably make sense to marshall such a thing into some custom escaped string representation
<jackdaniel> this list http://unicode.org/emoji/charts/full-emoji-list.html doesn't seem half bad
<Bike> the hieroglyph for poop looks more like a pear
<jmercouris> jackdaniel: for example, I can imagine a pictogram indicating "restroom" would be very useful
<Bike> that seems like an odd decision, egypt
<Bike> guess it wad distorted over time
<jackdaniel> jmercouris: there is emoji indicating restroom, yes
<jmercouris> right, but then you have one indicating cowboy smiling
<shka__> aaaaaaaaaaaand now we are discussing emojis
<jmercouris> I can't imagine the practical application of such a sign
<Bike> elderK: i mean it's like implementing arithmetic yourself. you can do it but it's not great.
<jackdaniel> you disagree with about, say, 256 characters in million, I'm sure someone found cowboy character useful if its there
<elderK> Bike: Aye. A couple years back I implemented a whole set of such encoding / decoding libraries in C for a project I was doing.
<White_Flame> aren't there a ton of combining forms for them as well as skin color modifiers and other meta stuff adding to implementation woes?
<elderK> I learned a lot. And it was just pure code-point decoding, no normalization or... you know, the harder stuff
<Bike> well, as you mentioned, C's built in string support is kind of crap anyway
<Bike> so you're not missing much
<elderK> Bike: Yeah, exactly.
<dim> kind of crap? you're so nice to C, C string is the hell
<dim> should you use memcpy, strcpy, strncpy, strlcpy, snprintf, xsnprintf or something else?
<jackdaniel> while it is not conforming, I think that treating C strings as byte arrays makes much more sense (sanity-wise)
<Bike> c's built in string support is kind of hell anyway, so you're not missing much
<dim> hehe
<White_Flame> and then there's C++ where there's a kabillion incompatible string implementations
<dim> having a character type and then arrays/vectors of characters looks like a simple and effective way at handling strings, I wonder why so few programming languages are doing that
<elderK> :) I hail from the land of C so I'm pretty aware of its issues. So, I'm pretty happy with CL :)
<White_Flame> that's a generic enough description that meets both C and Lisp
<jackdaniel> dim: not so fast, C did that already and we all agree it is hell. you need a specific array implementation too
<elderK> And a specific character type :P
<elderK> Which means like, making a decision in stone :P Or saying "Implementation-defined"
<White_Flame> C has a specific character type
<elderK> And then bang, back where C is
<elderK> :P
<elderK> Or Pascal.
<dim> jackdaniel: C doesn't have a type for characters, it has signed/unsigned 8-bits thing named char, that's very different
<elderK> That /is/ its character type. int8_t, uint8_t is raw bytes :P
<dim> and depending on the architecture, char may be signed or unsigned
<jackdaniel> dim: that's not what the standard says
<dim> do you have a link I should read, I'm interested?
<jackdaniel> char is a smallest addressable unit that can contain basic character set
<jackdaniel> I first looked here: https://en.wikipedia.org/wiki/C_data_types , but usually I refer to c99 standard when I look up things
<dim> it's meant for single-byte characters only, not a character as in CL, right?
<dim> basically a char in C is a byte, IIUC
<jackdaniel> I think that this is how it is usually implemented
<dim> yeah your wiki page sayth that char in C is an integer type
<White_Flame> given that string literals become char arrays/pointers, that strongly indicates that a char is in fact a character
makomo has joined #lisp
<White_Flame> if the name didn't give it away ;)
<dim> I like the character data type in CL where you are actually dealing with characters and then you may represent them in a different external-format if needed, or even read them from a different external-format
<dim> White_Flame: but it's not really, it's just a number that fits in a byte. You can't reprensent multi-byte unicode characters in a single char in C! it's not a character…
<dim> well now I look like I'm trolling so I'll stop here
<jackdaniel> dim: where did it say it fits in a byte?
<elderK> dim: And who's to say some CL implementation's character type also supports multibyte characters?
<elderK> You are assuming they do.
<elderK> That, afaik, is not standardized.
<elderK> In practice, sure.
<elderK> But not necessarily everywhere.
<White_Flame> dim: yeah, that's not a reasonable argument
<White_Flame> what C defines as a character does not have to include anybody else's definition of a character, including unicode's
<dim> nope, the CL standard makes it so that you may do whatever you want to support the implementation's character range, the C standard says that a char is the smallest adressable unit (usually a 8-bits byte) without respect for the character encodings / code points you might need to fit in there
<dim> anyway
<jackdaniel> dim: i.e here (c99), there is a section about multibyte characters: http://www.open-std.org/jtc1/sc22/WG14/www/docs/n1256.pdf (section 5.2)
<dim> C has no clue about UTF-8 or the like
<dim> CL is pretty good at UTF-8 and the like, using its standard API and data types from the 80s
<White_Flame> C defines what you fit in its character type. It owns that type and its defintion, nothing else does
<jackdaniel> dim: smallest addressable unit may be UTF-8 or whatever. afair lisp machine compilers for C had address length = 1 and mapped char into host lisp characters
<White_Flame> it's not a _useful_ charcer type in the grand scheme of things, but it is C's character type
<dim> yeah well I guess I just hate C string handling with some passion
<elderK> dim: And that's a valid feeling :)
<elderK> :D
<jackdaniel> I agree that C strings are disasters as they are handled, but character is implementation dependent (like in CL) and they are kept in arrays (and, yuck, null terminated)
<jackdaniel> are a disaster*
<elderK> jackdaniel: Well, it's all trade-offs. It's terminate them in some way or store their length in some other way.
<dim> IME it's only been arrays of bytes, for any practical purposes you can't handle them as arrays of something that would know the current encoding…
<elderK> And then you have to say: How many bytes will I use to store the length? Or will I encode the strings in an interesting way so that I can tell how many bytes are required for the length?
<elderK> Or have a bunch of different types for strings of different length :P
<elderK> Trade offs on trade offs.
<elderK> dim: Well, sure. But C is arguably a lower-level language than CL. So, it makes sense that if you need such support, you implement it or use a library.
<jackdaniel> ECL is a nice library for use in C for unicode ;-)
<dim> elderK: PostgreSQL has a good variable-length data-type for that with a length header that's either 1-byte or 4-bytes, limiting the size of varchar/text columns to 1GB - 4 byte, which is practical
<dim> jackdaniel: +1 ;-)
<elderK> dim: Right.
<elderK> dim: I'm just saying that such decisions need to be made. And well, sometimes it is not always so clear cut which to do.
<elderK> I can understand why they decided on null terminators.
<jackdaniel> having a null canary certainly seemed to make sense at some point of time, but from the historical perspective it was a huge mistake
<elderK> Agreed
<elderK> It makes sense in context, like.
<elderK> Just like having DNS records publically visible made sense once.
<elderK> :P
<elderK> And now registrant info is used to spam email or call you at all hours.
<elderK> (I have experienced this...)
<White_Flame> it's "The Unix Way"
<elderK> No, for the 13th time, I am not interested in purchasing stocks in diamonds.
<elderK> :|
<White_Flame> since all the old use cases was sending literal text lines between processes
<jackdaniel> dim: this is a fun read: https://begriffs.com/posts/2018-11-15-c-portability.html, they even mention symbolics c implementation
<shka__> White_Flame: you are saying that essentially it was all because strings were doing double duty as streams?
<White_Flame> yes, and control codes were meaningful
<elderK> jackdaniel: Thanks for the interesting links :)
<shka__> White_Flame: i had no idea that this was motivation behind this
<shka__> thanks, i learned something new
<White_Flame> it's my interpretation of history I wasn't a part of, so here's your grain of salt
<jackdaniel> I think that some phrasing in the original ANSI C standard would be different if not they didn't take into account Lisp Machines
<jackdaniel> (I think I've read somewhere)*
<jackdaniel> elderK: this may be also interesting to you: https://github.com/vsedach/Vacietis
notzmv has quit [Ping timeout: 250 seconds]
<elderK> Thanks :)
<elderK> Isn't that a skin eating disease or something? :D
<elderK> OH WOW!
<elderK> COOL :D
<elderK> THANKS!
<jackdaniel> readme has a link to zeta-c compiler for lisp machines
<elderK> I think it will be a long time until I can understand it :) But wow, so cool :D
<fiddlerwoaroof> There's also https://github.com/froggey/Iota
<jackdaniel> llvm->CL transpiler
<dim> jackdaniel: yeah begriffs (Joe Nelson) is currently a colleague of mine ;-)
<jackdaniel> oh, cool :-)
<jackdaniel> please tell him that I've really enjoyed reading this post
<elderK> God, it would be a dream to understand that kind of thing. To know CL well enough to help out froggey.
<elderK> Thanks fiddlerwoaroof
<jackdaniel> elderK: I believe there are tasks which may be worked out with a modest CL knowledge
<elderK> I really wish my Uni had like, papers on compiler and stuff.
<jmercouris> so I have a bit of a problem, I have a struct, that has a field which is a list of strings
sunset_NOVA has quit [Quit: leaving]
<jackdaniel> asking if you can help with something on #mezzano would be a good thing
<elderK> I've always wanted to get into them. The farthest I've got is learning about parsing, like, recursive descent and LL1 and stuff.
<elderK> And DFAs and all that jazz.
razzy has quit [Remote host closed the connection]
<jmercouris> now, I can use this struct as a key in hashmap
<elderK> jackdaniel: I might just do that :)
<jmercouris> HOWEVER, when I try to generate an equivalent hashmap to retrieve the key, it is not retrieved
razzy has joined #lisp
<jmercouris> s/hashmap/struct
<dim> what :test is your hash-table using jmercouris?
<shka__> jmercouris :test 'equal for make-hashtable
<jmercouris> shka__: I made it equalp already
<dim> default is 'eq and that means you're only trying to find the same struct instance (pointer equality), not another struct that shares common elements
<elderK> jmercouris: How are you generating the equivalent hash ma?
<jmercouris> let me make some repl output that clears up everything one second
<jackdaniel> show the code, I'm sure you'll have some mistake there which we'll be able to spot (instead of guessing)
<jmercouris> Yes, I will, one moment
<elderK> jmercouris: I'd like to learn from your code, too :)
rozenglass has joined #lisp
<jmercouris> interesting, it is working in the repl, there must be something different going on in my code
<jackdaniel> first trying, then preparing code and at last asking may be a better strategy then a reversed one ;-)
<jmercouris> I did first try :D
<jmercouris> I should have tried first in the REPL, I misdiagnosed my problem
confusedwanderer has joined #lisp
<elderK> jmercouris: Also, be aware that structures themselves are compared shallowly.
<elderK> I figure you are already aware of that.
<jmercouris> alright, so here is what is very strange
<jmercouris> I have found out my issue
<jackdaniel> elderK: they are not, equalp is used to compare slots
<elderK> What was it?
<jmercouris> (alexandria:hash-table-keys *document-mode-map*) will come up with
<jmercouris> #S(KEY-CHORD :KEY-CODE NIL :KEY-STRING ("l") :MODIFIERS ("C"))
<elderK> jackdaniel: Yes - but if you compare a slot that is not like, a string or something, say another structure.
<Bike> nope, still equalp
<jmercouris> HOWEVER, when the user executes a key-press it will do this:
<jmercouris> #S(NEXT::KEY-CHORD :KEY-CODE NIL :KEY-STRING "l" :MODIFIERS ("C"))
<Bike> equalp is very much recursive
<elderK> jackdaniel: Does it descend completely?
<jackdaniel> what Bike said
<elderK> Okay, my bad :)
<jmercouris> ah, I see the issue, it is a list
<jmercouris> when it should be a string!
<jackdaniel> there is also an interesting CDR document about extensible equals predicate
<Bike> jmercouris: check your make-key-chord i guess
<jackdaniel> I very much like the idea
<ogamita> jackdaniel: yes, 1500 emojis is a big number. Instead, we could have 1444 combining glyphs of 1 pixel (38 high x 38 wide), and you could draw any emoji up to 38x38 using combinations!
<Bike> er, calls to it
<elderK> What about if a slot is an array? And that array has references to other structure instances?
<jmercouris> it is when I am making it in the keyboard
<jmercouris> sorry kbd function
<Bike> elderK: still recursive
<Bike> clhs equalp
<Bike> just look
<jmercouris> I should car it
<Bike> two structs are equalp if they're the same class and have equalp slots
<ogamita> jackdaniel: or once you've noted the siliness, just extend unicode with a graphic language to draw anything.
<jmercouris> I call (last keys), instead of (car (last keys))
<ogamita> perhaps metafont…
<jackdaniel> ogamita: I think that wouldmiss the point of having named characters
<ogamita> You already lose that, with combining codepoints.
<jmercouris> always bothered me that last returns a list
<elderK> Bike: I did. But I did misremember :)
<elderK> Sometimes it is hard to keep eq / eql / equal / equalp straight in my head :)
<jackdaniel> namely this: https://common-lisp.net/project/cdr/document/8/cleqcmp.html (re equals predicate)
<ogamita> However, when you use equalp, strings are compared case insensitively.
<ogamita> So #S(NEXT::KEY-CHORD :KEY-CODE NIL :KEY-STRING "l" :MODIFIERS ("C")) and #S(NEXT::KEY-CHORD :KEY-CODE NIL :KEY-STRING "L" :MODIFIERS ("c")) will be equalp.
<heisig> elderK: Use eq to check for object identity (or, forget about eq and always use eql), use eql for things that might also be numbers or characters, and use equal for s-expressions. Don't use equalp unless you know what you are doing.
fikka has quit [Ping timeout: 245 seconds]
<jackdaniel> so that leaves us eql and equal to remember :)
vlatkoB has quit [Quit: No Ping reply in 180 seconds.]
fikka has joined #lisp
vlatkoB has joined #lisp
shrdlu68 has quit [Ping timeout: 268 seconds]
robdog_ has quit [Remote host closed the connection]
<elderK> heisig: Any examples for what would be correct use of equalp?
jetchisel has joined #lisp
<ogamita> elderK: there are no incorrect use of equalp! or of any other operator. Just read the specification, and see if it's adapted to your need.
<elderK> Roger that :)
<ogamita> (list (equal "Pascal" "PASCAL") (equalp "Pascal" "PASCAL")) #| --> (nil t) |#
<ogamita> (list (string= 'pascal "Pascal") (string-equal 'pascal "Pascal")) #| --> (nil t) |#
<ogamita> Notice how string= compares string designators (including characters and symbols), while equal compares objects (same type).
yvy has quit [Read error: Connection reset by peer]
<ogamita> (list (string= "a" #\a) (string-equal "a" 'a)) #| --> (t t) |#
<elderK> THank you for pointing that out
<elderK> I did /not/ notice that at first.
<ogamita> (= (mismatch "hello world!" "aworlding" :start1 6 :start2 1 :end2 7) (+ 6 (- 7 1) -1)) #| --> t |#
<ogamita> mismatch can be used to compare substrings with substrings.
<ogamita> can also work with sequences: (= (mismatch "hello world!" '(#\a #\w #\o #\r #\l #\d #\i #\n #\g) :start1 6 :start2 1 :end2 7) (+ 6 (- 7 1) -1)) #| --> t |#
<elderK> I keep forgetting that a string is a sequence :D
<elderK> :) Neat
jmercouris has quit [Ping timeout: 244 seconds]
pierpal has quit [Quit: Poof]
pierpal has joined #lisp
jochens_ has joined #lisp
nicksmaddog has joined #lisp
dddddd has quit [Ping timeout: 246 seconds]
jochens has quit [Ping timeout: 245 seconds]
jetchisel has quit [Quit: Unfortunately time is always against us -- [Morpheus]]
dddddd has joined #lisp
khisanth_ has quit [Ping timeout: 245 seconds]
slyrus has quit [Quit: slyrus]
slyrus has joined #lisp
khisanth_ has joined #lisp
frgo has joined #lisp
bradfonseca has joined #lisp
jochens_ has quit [Remote host closed the connection]
jochens has joined #lisp
fikka has quit [Ping timeout: 268 seconds]
matzy_ has quit [Ping timeout: 244 seconds]
fikka has joined #lisp
jochens has quit [Remote host closed the connection]
jochens has joined #lisp
ak5 has joined #lisp
solyd_ has joined #lisp
solyd has quit [Ping timeout: 252 seconds]
FreeBirdLjj has joined #lisp
fikka has quit [Ping timeout: 264 seconds]
smokeink has quit [Remote host closed the connection]
fikka has joined #lisp
cage_ has joined #lisp
Inline has joined #lisp
elderK has quit [Ping timeout: 244 seconds]
fikka has quit [Ping timeout: 252 seconds]
elderK has joined #lisp
JohnMS_WORK has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
dale has joined #lisp
<elderK> jackdaniel: That post btw, the retrocomputing one, was very interesting.
<elderK> :) I am now trying to locate somewhere to download that Portable C book.
<elderK> It sounds like it wound be an entertaining read.
lmy9900 has joined #lisp
fikka has joined #lisp
Zaab1t has quit [Ping timeout: 246 seconds]
Bronsa has joined #lisp
jfranci__ has joined #lisp
nowhere_man has joined #lisp
les` has quit [Quit: ""]
Kevslinger has joined #lisp
jdz has joined #lisp
rippa has joined #lisp
Zaab1t has joined #lisp
fikka has quit [Ping timeout: 264 seconds]
solyd_ has quit [Quit: solyd_]
anamorphic has joined #lisp
solyd has joined #lisp
sjl_ has joined #lisp
fikka has joined #lisp
frgo has quit [Remote host closed the connection]
figurelisp has quit [Quit: Lost terminal]
fikka has quit [Ping timeout: 246 seconds]
fikka has joined #lisp
solyd has quit [Quit: solyd]
jfranci__ has quit [Remote host closed the connection]
jfrancis has joined #lisp
fikka has quit [Ping timeout: 268 seconds]
jfrancis_ has joined #lisp
fikka has joined #lisp
heisig has quit [Quit: Leaving]
lmy9900 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
fikka has quit [Ping timeout: 272 seconds]
themsay has quit [Ping timeout: 250 seconds]
varjag has quit [Quit: ERC (IRC client for Emacs 25.2.2)]
Necktwi has joined #lisp
beach has joined #lisp
jetchisel has joined #lisp
Necktwi has quit [Client Quit]
<jfrancis> Anyone here happen to be good with cl-json? I've got an issue that's making me insane. Been using it for years, first time I've run into this.
solyd has joined #lisp
<dlowe> what's the issue?
<jfrancis> If I have this bit of JSON: {"sources":{"include":[[{"label":{"href":"/orgs/1/labels/41"}}]],"exclude":[{"ip_address":{"value":"10.1.0.27"}}]}}
<jfrancis> when I do this: (princ (json:encode-json-alist-to-string (json:decode-json-from-string "{\"sources\":{\"include\":[[{\"label\":{\"href\":\"/orgs/1/labels/41\"}}]],\"exclude\":[{\"ip_address\":{\"value\":\"10.1.0.27\"}}]}}")))
<jfrancis> I get this: {"sources":[["include",[{"label":{"href":"\/orgs\/1\/labels\/41"}}]],["exclude",{"ip_address":{"value":"10.1.0.27"}}]]}
<dlowe> interesting.
<jfrancis> Note that "sources" gets magically transformed into an array. Which breaks my REST call horribly. Obviously, I'm not just converting to a list, then back. I'm doing useful stuff in between.
<jfrancis> But that's the simplest test case I can boil it down to. I *could* re-write everything with yason. But it's vastly different in the way it works, and will require re-writing three years of code (thankfully, 80% of it is in one file, but not 100%). Would prefer not to do that.
<dlowe> the json decoding doesn't leave distinguishing markers on whether something is a list or an object
<dlowe> and it looks like it's guessing wrong when re-encoding.
kajo has joined #lisp
jack_rabbit has quit [Ping timeout: 252 seconds]
<jfrancis> Yeah. And I could actually live with that if I had a way to force cl-json to do what I want. I already have to do that with things like an empty list (you have to do (make-array 0) to force it to encode "[]" instead of "false").
<_death> personally I recommend com.gigamonkeys.json that does roundtripping correctly without tweaking configuration
beach has quit [Disconnected by services]
beach has joined #lisp
beach has quit [Disconnected by services]
FreeBirdLjj has quit [Remote host closed the connection]
beach has joined #lisp
<jfrancis> That does work. But the amount of effort required to convert three years of code from the cl-json way of doing things to the gigamonkeys way makes me sad.
<jfrancis> (princ (com.gigamonkeys.json:json (com.gigamonkeys.json:parse-json "{\"sources\":{\"include\":[[{\"label\":{\"href\":\"/orgs/1/labels/41\"}}]],\"exclude\":[{\"ip_address\":{\"value\":\"10.1.0.27\"}}]}}")))
<jfrancis> {"sources":{"include":[[{"label":{"href":"/orgs/1/labels/41"}}]],"exclude":[{"ip_address":{"value":"10.1.0.27"}}]}}
<jfrancis> I was hoping there was a way to hack/coerce/force cl-json to do what I want. I build most of the objects in my code, anyway. I could just build them the way cl-json wants them to give me what I need.
<jackdaniel> my eyes hurt
<jfrancis> yeah, ditto
fikka has joined #lisp
<sjl_> This is why the #1 most important feature for any JSON lib I use is "encodes and decodes unambiguously"
<Fade> a pastebin would be preferred.
<jfrancis> Imagine spending all day every day staring at JSON. :D
<jfrancis> fair enough. next time.
<dlowe> json:set-decoder-simple-clos-semantics *seems* like it could work, but it barfs on your example json
<dlowe> which does not inspire great confidence
<dlowe> (also, its fluid-class metaclass is kinda neat)
<jfrancis> yason works. so does com.gigamonkeys.json. But both require a huge code refactor.
<_death> iirc there is a way to make cl-json work, but it will of course change the representation
<jfrancis> It's much more straightforward to build lists, then convert them, than to build hashes and/or hashes and vectors.
robotoad has joined #lisp
<dlowe> that's because the built-in hash/vector creation in CL is terrible
<jfrancis> And probably a crapton less GCing.
<jackdaniel> jfrancis: jsown is unambigous and fastest (according to benchmarks we did some time ago), though it is a little pita to use it with all `(:obj …) stuff
<jackdaniel> yason otoh is the most convenient library (but I use it only for repl, production code works on jsown)
<jfrancis> Oddly enough, performance is about #1045 on my list of priorities. The elapsed time of the REST API call dwarfs any compute time in my code.
* jfrancis goes off to look at jsown
<pfdietz> I think you want an encoder/decoder that converts json boolean into something other than T/NIL. :true and :false, maybe.
<sjl_> You can make hash/vector use less awkward with some greasy generic functions, e.g. https://github.com/sjl/cacl/blob/master/src/base.lisp#L77-L90
<jackdaniel> pfdietz: question is whenever NIL is :false or an empty list
<jackdaniel> ah, json boolean → lisp
<jackdaniel> nvm
<pfdietz> Right
<sjl_> It's still a little clumsy, but at least things will be unambiguous and actually work correctly.
FreeBirdLjj has joined #lisp
<sjl_> And you can always go full Clojure and define a #{} reader macro to wrap alexandria:alish-hash-table
<jfrancis> I can work around the :true/:false t/nil issue, given how rigorously the API is defined (ie, I can guess correctly 100% of the time). The issue I can't work around is that cl-json improperly converts my data into an array instead of a key/value.
FreeBirdLjj has quit [Ping timeout: 245 seconds]
FreeBirdLjj has joined #lisp
orivej has quit [Ping timeout: 252 seconds]
Roy_Fokker has joined #lisp
frgo has joined #lisp
anewuser has quit [Quit: anewuser]
<fiddlerwoaroof> jfrancis: you could probably also use these special variables to make decoding unambiguous: https://common-lisp.net/project/cl-json/cl-json.html#DECODER-CUSTOMIZATION
<fiddlerwoaroof> but it might be less work to convert to yason or similar
hiroaki has joined #lisp
jinkies has joined #lisp
jmercouris has joined #lisp
hiroaki has quit [Quit: Leaving]
<jmercouris> I want to do something like DELETE-IF but with hashtable, how can I do this?
<jmercouris> I'm hesitant to iterate over the hashtable keys and do remhash because I have a feeling it won't like that
hiroaki has joined #lisp
milanj has joined #lisp
<jackdaniel> (let ((to-remove nil)) (maphash #'(lambda (k v) (when (pred v) (push v to-remove))) ht) (mapc #'remhash* to-remove))
Necktwi has joined #lisp
<_death> jmercouris: the standard guarantees that you should be able to do that for the entry currently being passed
<sjl_> Yep, it's explicitly allowed in clhs maphash
<sjl_> clhs maphash
lumm has joined #lisp
<sjl_> come on bot
<jmercouris> so it's not necessary to make an intermediate list then
<jmercouris> ok, good to know, thanks
<sjl_> yeah, (maphash (lambda (k v) (when (funcall predicate k v) (remhash foo k)) foo) should be portable
<jmercouris> perfect
<jmercouris> makes it a one-liner :)
<sjl_> You could still make a REMHASH-IF function that wraps it up nicely
<_death> yep.. that would save you from errors like pushing value instead of key, or rotating the arguments to remhash ;)
<sjl_> ugh, yet another instance of *hash functions having the opposite arg order to what I expect
<sjl_> I hate them.
wusticality has joined #lisp
<jmercouris> I always find myself staring at the echo area while programming in lisp
<sjl_> I'd probably hate NTH for the same reason if I ever used it.
<_death> those use the "English-like" convention
<_death> although you could concoct plausible English sentences with reversed order
<sjl_> which is the opposite of the ELT/AREF convention
<_death> well, AREF can take more than once index
<sjl_> Right, so AREF needs to be that way
kajo has quit [Ping timeout: 276 seconds]
<_death> same argument for MAPCAR taking lists after the function.. while it could make sense for (single) sequence functions to take the sequence first, I guess
Odin- has joined #lisp
confusedwanderer has quit [Remote host closed the connection]
<sjl_> I'd still probably lean toward taking the predicate first, because (curry #'mapcar #'pred) to make map-pred seems more useful than (curry #'mapcar somelist), which would be... map-over-some-particular-list
confusedwanderer has joined #lisp
<sjl_> and rcurry is awkward
<sjl_> (setf (symbol-function 'clowncar) (curry #'mapcar #'clown))
Roy_Fokker has quit [Quit: Leaving]
hhdave has quit [Ping timeout: 268 seconds]
pjb has joined #lisp
ski has quit [Ping timeout: 245 seconds]
arbv has quit [Quit: ZNC - https://znc.in]
Myon has quit [Remote host closed the connection]
jochens has quit [Remote host closed the connection]
jochens has joined #lisp
<ogamita> sjl_: perhaps it's portable, but it better has to be conforming!
lonjil2 has joined #lisp
lonjil has quit [Ping timeout: 250 seconds]
<ogamita> The nth element of the list (nth n list); Let's reference the array a with the indices i j k (aref a i j k).
m00natic has quit [Read error: Connection reset by peer]
freehck has quit [Ping timeout: 240 seconds]
shka_ has joined #lisp
jochens has quit [Ping timeout: 240 seconds]
<ogamita> (defun at-indices-of-array (&rest arguments) (apply (function aref) (first (last arguments)) (butlast arguments))) (at-indices-of-array 1 0 #2A((a b) (c d))) #| --> c |#
frodef has quit [Ping timeout: 244 seconds]
jetchisel has quit [Ping timeout: 240 seconds]
solyd has quit [Remote host closed the connection]
jetchisel has joined #lisp
griddle has left #lisp ["The Lounge - https://thelounge.github.io"]
anamorphic has quit [Quit: anamorphic]
<pfdietz> And let us not forget ELT.
varjag has joined #lisp
Kaisyu has quit [Quit: Connection closed for inactivity]
beach has quit [Ping timeout: 250 seconds]
anamorphic has joined #lisp
shifty has quit [Ping timeout: 252 seconds]
Roy_Fokker has joined #lisp
Essadon has joined #lisp
ski has joined #lisp
SaganMan has quit [Ping timeout: 276 seconds]
<Xach> RIP
PuercoPop has quit [Quit: ZNC 1.6.3 - http://znc.in]
PuercoPop has joined #lisp
malice has joined #lisp
wusticality has quit [Ping timeout: 245 seconds]
rozenglass has quit [Remote host closed the connection]
jmercouris has quit [Remote host closed the connection]
rozenglass has joined #lisp
jinkies has quit [Ping timeout: 240 seconds]
Mr-Potter has joined #lisp
Roy_Fokker has quit [Read error: Connection reset by peer]
cage_ has quit [Quit: Leaving]
orivej has joined #lisp
robdog has quit [Ping timeout: 250 seconds]
kajo has joined #lisp
lmy9900 has joined #lisp
Zaab1t has quit [Quit: bye bye friends]
jfrancis_ has quit [Ping timeout: 240 seconds]
fikka has quit [Ping timeout: 244 seconds]
jkordani_ has joined #lisp
lmy9900 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
vlatkoB has quit [Remote host closed the connection]
jkordani has quit [Ping timeout: 240 seconds]
jack_rabbit has joined #lisp
mathrick has quit [Ping timeout: 260 seconds]
robotoad has quit [Quit: robotoad]
DGASAU has joined #lisp
<jcowan> It shouldn't be that hard to hack an interface to <good JSON package> that mimics <bad JSON package>.
rozenglass has quit [Remote host closed the connection]
sauvin has quit [Remote host closed the connection]
wusticality has joined #lisp
themsay has joined #lisp
anamorphic has quit [Quit: anamorphic]
fikka has joined #lisp
themsay has quit [Ping timeout: 245 seconds]
mejja has joined #lisp
milanj has quit [Quit: This computer has gone to sleep]
anamorphic has joined #lisp
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #lisp
FreeBirdLjj has quit [Ping timeout: 244 seconds]
DGASAU has quit [Ping timeout: 260 seconds]
<dim> I would have though that we had enough JSON packages already
Kevslinger has quit [Quit: Connection closed for inactivity]
<dlowe> now we need json library adapters
<jackdaniel> Greenspun's eleventh rule: there is never enough JSON packages and lisp implementations. :-)
<Xach> someone just submitted a new test framework for quicklisp :~(
<jackdaniel> oh, I forgot to add test frameworks to the pack
<dim> what about channeling this fabulous energy to McCLIM and a pure-CL dev environment (listener, editor, debugger, etc etc) that would compare favorably to DrRacket and its tutorial with images?
<jackdaniel> robim co możem ;-)
<dim> so that next time a newcomer to CL asks questions about getting started, they just use thing new thing instead of having to learn SLIME or some derivatives
<jackdaniel> (in Polish, jokingly: "I do what I can")
<malice> jackdaniel: Hi! You're maintainer of both McClim and ECL projects, right? I suggest that you take a look at Google Summer of Code: https://opensource.googleblog.com/2018/11/google-summer-of-code-15-years-strong.html
<sjl_> I've successfully resisted the temptation to write my own test framework and/or JSON library so far. I'm fighting the good fight.
<dim> jackdaniel: I know you do, and I'd like to help, I don't have enough time to reproduce and fix pgloader issues already, unfortunately, though
<malice> The registration for organizations starts in january, so there's still some time to familiarize yourself with the project if you were interested.
<jackdaniel> malice: I'm afraid I'll have plenty on my head on January
froggey_ is now known as froggey
<jasom> Google SoC might get you future contributors, but it's rare that useful contributions come out of it.
<jackdaniel> I'm expecting a child by that time
<malice> jackdaniel: congratulations!
<jackdaniel> thank you
<Xach> dim: i don't think enthusiasm is fungible
<malice> Well, if you manage to prepare that, I believe it might be beneficial (or maybe someone can do it for you?)
<jackdaniel> if someone does that I'll be happy to to approve, suref
<jasom> Gratulacje!
<jackdaniel> sure*
<jackdaniel> thanks. probably I shouldn't go on with that on a public channel, sorry
<malice> jasom: I think it would be beneficial because (1) people would browse GSoC to find projects. Some of those people could get familiar with Lisp and its projects by seeing those there
<malice> (2) we might get new people for the community
<jasom> malice: right, there are benefits, but it's not what it immediately appears to be
<malice> I agree. This is best thought of as a way of easing a person into the project and/or its ecosystem
<malice> I've seen some pretty useless projects
<malice> But, they're paying for it, so that's nice.
<jasom> speaking of which, what's a current need for McClim that isn't getting some TLC (other than non-X11 backends; I don't use any non x-11 guis regularly so wouldn't be uesful for me)
<dim> Xach: often enough it's contagious tho, which is already a good start ;-)
<jackdaniel> what is TLC?
<no-defun-allowed> Tender loving care?
<no-defun-allowed> Something like that.
<jackdaniel> jasom: this ticket would be a big step in good direction: https://github.com/McCLIM/McCLIM/issues/35
jochens has joined #lisp
<jackdaniel> this would make life easier when using the Listener: https://github.com/McCLIM/McCLIM/issues/307
<jackdaniel> as of bugs, there is plenty on the tracker to pick from
debsan has quit [Excess Flood]
debsan has joined #lisp
<jasom> jackdaniel: what extensions can the X11 backend assume the server will have (or more generally which X servers do you wish to support)?
jochens has quit [Ping timeout: 245 seconds]
<jackdaniel> right now it supports very old x11, but we are slowly moving towards xrender model
<jasom> ugh, this is clx based. clx is ... special ...
<jackdaniel> well, clx is pure CL
<jackdaniel> and I kinda maintain it too
<jackdaniel> I'm afk now, see you later \o
hiroaki has quit [Remote host closed the connection]
<jasom> o/
scottj has joined #lisp
debsan has quit [Ping timeout: 252 seconds]
<jcowan> so I am now working on CL-R, an effort to define a subset of CL
<jcowan> stands for "Common Lisp - Restricted" or "Common Lisp Minus Reflection"
<sjl_> Not Common Lessp?
jinkies has joined #lisp
<jcowan> Ooh, nice!
<sjl_> C<
debsan has joined #lisp
Odin- has quit [Ping timeout: 246 seconds]
shka_ has quit [Ping timeout: 276 seconds]
<jcowan> Unlike CLICC CL1 and stand-alone CL0 it will be based on ANS CL and will not restrict the language of macros, since I assume the compiler will be written in full CL.
<Bike> does "reflection" include things like fdefinition
milanj has joined #lisp
<malice> Bike: I guess it depends on the definition of "reflection" that you're using :)
<Bike> yeah that's... why i'm asking.
energizer has quit [Quit: ZNC 1.7.0+deb0+xenial1 - https://znc.in]
energizer has joined #lisp
<malice> I wouldn't call it that, but I can see why some people would.
<Bike> i am asking about jcowan's plan specifically.
<malice> Oh, right!
jkordani_ has quit [Read error: Connection reset by peer]
frgo has quit [Remote host closed the connection]
frgo has joined #lisp
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
yvy has joined #lisp
frgo has quit [Read error: Connection reset by peer]
yvy has quit [Client Quit]
<jcowan> I think so, but I'm open to arguments against. It seems only trivially different from symbol-function at first glance
yvy has joined #lisp
<Bike> that's right.
rozenglass has joined #lisp
phlm has joined #lisp
phlm has quit [Remote host closed the connection]
phlm has joined #lisp
<jcowan> so probably excluded
phlm has quit [Remote host closed the connection]
<jcowan> I also need to look at how ECL does some things
phlm has joined #lisp
themsay has joined #lisp
themsay has quit [Read error: Connection reset by peer]
themsay has joined #lisp
themsay has quit [Read error: Connection reset by peer]
themsay has joined #lisp
phlm has quit [Remote host closed the connection]
anamorphic has quit [Quit: anamorphic]
nicksmaddog has quit [Quit: Leaving]
anamorphic has joined #lisp
bradfonseca has quit [Quit: Konversation terminated!]
ski has quit [Remote host closed the connection]
confusedwanderer has quit [Remote host closed the connection]
<dim> kinlo: the new file https://github.com/dimitri/pgloader/blob/master/bundle/save.lisp should help you build pgloader from the bundle distribution, you just need to prepare a version.sexp file containing "3.5.2" with the quotes and then either sbcl --no-userinit --load ./save.lisp or ccl -l save.lisp
<dim> (and if not using the bundle, there's another save.lisp that works from QL directly)
warweasle has quit [Quit: rcirc on GNU Emacs 24.4.1]
jack_rabbit has quit [Ping timeout: 260 seconds]
rjid has joined #lisp
rjid has quit [Ping timeout: 256 seconds]
kajo has quit [Ping timeout: 252 seconds]
hiroaki has joined #lisp
scymtym has quit [Ping timeout: 252 seconds]
lavaflow has quit [Quit: WeeChat 2.2]
frodef has joined #lisp
les has joined #lisp
oystewh has joined #lisp
sz0 has joined #lisp
arbv has joined #lisp
warweasle has joined #lisp
<pjb> I'm trying to use asdf:make-build, but I get errors "An error occurred during initialization: Component "<my-system>" not found.", even if I quickload successfully "<my-system>" before asdf:make-build. What would be the problem?
<pjb>
<pjb> (in ECL 16.1.2 I should mention).
frgo has joined #lisp
scymtym has joined #lisp
frgo has quit [Ping timeout: 246 seconds]
yvy has quit [Read error: Connection reset by peer]
wusticality has quit [Ping timeout: 264 seconds]
Necktwi has quit [Read error: Connection reset by peer]
antonv has joined #lisp
<antonv> is there a way on SBCL to see what threads are doing?
<minion> antonv, memo from fiddlerwoaroof: (:component "foo" :if-feature :darwin)
<antonv> I have a thread hanging, would like to know its current stracktrace
<antonv> That's in slime
Necktwi has joined #lisp
<dim> pjb: could it be that you're using QL facilities to find your projects that are unknown to ASDF itself? ql:*local-project-directories* comes to mind
<pjb> I've set asdf:*central-registry* with the paths to the directories where all my asd are.
robotoad has joined #lisp
<pjb> But otherwise, quicklisp is loaded…
<pjb> Perhaps I should also add quicklisp systems, there are probably dependencies…
<dim> (asdf:initialize-source-registry) might be necessary after setting the central registry
<pjb> ok.
dacoda has joined #lisp
<pjb> Nope, same result with all the directories containing asd in the project and in ~/quicklisp in asdf:*central-registry*, and with (asdf:initialize-source-registry)…
<dim> time to read and understand the source code of ASDF then I suppose
<pjb> Yes. Unfortunately, ecl's debugger is not much help here.
<pjb> Ok, it's an asdf problem with this setup. (asdf:oos 'asdf:load-op "<my-system>") fails too. Not specific to asdf:make-build. I'll debug that tomorrow.
dacoda has quit [Ping timeout: 260 seconds]
varjag has quit [Read error: Connection reset by peer]
smokeink has joined #lisp
rumbler31 has joined #lisp
jetchisel has quit [Quit: Unfortunately time is always against us -- [Morpheus]]
cmjones has quit [Ping timeout: 260 seconds]
lmy9900 has joined #lisp
anamorphic has quit [Quit: anamorphic]
malice has quit [Ping timeout: 256 seconds]
lmy9900 has quit [Client Quit]
lmy9900 has joined #lisp
wusticality has joined #lisp
lmy9900 has quit [Client Quit]
lumm has quit [Quit: lumm]
pillton has joined #lisp
sjl_ has quit [Quit: WeeChat 2.3-dev]
frodef has quit [Ping timeout: 240 seconds]
nirved is now known as Guest90499
Guest90499 has quit [Killed (leguin.freenode.net (Nickname regained by services))]
nirved has joined #lisp
ryan_vw has joined #lisp
Kaisyu has joined #lisp
Kundry_Wag has joined #lisp
Kundry_Wag has quit [Ping timeout: 244 seconds]
rumbler31 has quit [Remote host closed the connection]
rumbler31 has joined #lisp
rumbler31 has quit [Remote host closed the connection]
Kundry_Wag has joined #lisp
wusticality has quit [Ping timeout: 246 seconds]
Essadon has quit [Quit: Qutting]
eschatologist has quit [Remote host closed the connection]
eschatologist has joined #lisp