jackdaniel changed the topic of #commonlisp to: Common Lisp, the #1=(programmable . #1#) programming language | Wiki: <https://www.cliki.net> | IRC Logs: <https://irclog.tymoon.eu/libera/%23commonlisp> | Cookbook: <https://lispcookbook.github.io/cl-cookbook> | Pastebin: <https://plaster.tymoon.eu/>
attila_lendvai has quit [Ping timeout: 260 seconds]
renatoathaydes has quit [Ping timeout: 250 seconds]
jebekab[m] has quit [Server closed connection]
jebekab[m] has joined #commonlisp
akoana has joined #commonlisp
renatoathaydes has joined #commonlisp
renatoathaydes has quit [Ping timeout: 260 seconds]
renatoathaydes has joined #commonlisp
renatoathaydes has quit [Ping timeout: 252 seconds]
dipper has joined #commonlisp
dra has quit [Ping timeout: 260 seconds]
random-nick has quit [Ping timeout: 258 seconds]
bilegeek has quit [Remote host closed the connection]
bilegeek has joined #commonlisp
bilegeek has quit [Max SendQ exceeded]
bilegeek has joined #commonlisp
renatoathaydes has joined #commonlisp
bilegeek_ has joined #commonlisp
renatoathaydes has quit [Ping timeout: 264 seconds]
bilegeek has quit [Ping timeout: 260 seconds]
bilegeek_ has quit [Read error: Connection reset by peer]
RavenJoad has joined #commonlisp
bilegeek_ has joined #commonlisp
notzmv has quit [Ping timeout: 260 seconds]
<RavenJoad> I am dipping my toes into CLOS right now, and have stumbled across a problem. I get a SIMPLE-ERROR while computing the class precedence list of VERILOG-GENERATOR. The HDL-GENERATOR class is simultaneously a forward referenced class and is a direct superclass of VERILOG-GENERATOR. I get the error from a function in a separate package that uses an instance of the VERILOG-GENERATOR class. The code is readable at
<ixelp> chil/source/backends at flet-nested-defun · KarlJoad/chil · GitHub
bilegeek_ has quit [Remote host closed the connection]
bilegeek_ has joined #commonlisp
renatoathaydes has joined #commonlisp
renatoathaydes has quit [Ping timeout: 240 seconds]
Inline has quit [Ping timeout: 260 seconds]
<bike> RavenJoad: you can't compute the class precedence list if there are forward referenced superclasses (because how would you)
<bike> make sure everything's fully defined before you get to making instances
<RavenJoad> That I understand; I am referencing HDL-GENERATOR in VERILOG-GENERATOR when HDL is not yet defined. What I do not understand is why this referencing is happening. In a Sly REPL, I do '(asdf:load-system :chil :force t) (in-package :chil)', and then call a function which makes an instance of VERILOG for testing. Shouldn't all the classes be defined and loaded into that REPL?
<RavenJoad> That test function just does (with-open-file (...) (generate (make-instance 'verilog-generator) ...)).
beach has quit [Remote host closed the connection]
<bike> I think I see the problem
<ixelp> chil/source/backends/base.lisp at main · KarlJoad/chil · GitHub
<bike> you probably want an (in-package #:chil/backends) in there.
<bike> without that hdl-generator will be defined in cl-user or some weirdness
beach has joined #commonlisp
JaguarKat has quit [Ping timeout: 252 seconds]
<RavenJoad> bike: I completely missed that! Thanks for picking that out. That fixed it.
<RavenJoad> You probably hit the nail on the head about what the symbols' final names would expand to. Thanks for finding that!
renatoathaydes has joined #commonlisp
renatoathaydes has quit [Ping timeout: 245 seconds]
renatoathaydes has joined #commonlisp
dipper has quit [Ping timeout: 250 seconds]
jebekab[m] has left #commonlisp [#commonlisp]
renatoathaydes has quit [Ping timeout: 250 seconds]
tyson2 has quit [Remote host closed the connection]
semz has quit [Quit: ZNC 1.8.2+deb2build5 - https://znc.in]
semz has joined #commonlisp
dipper has joined #commonlisp
johnjaye has quit [Ping timeout: 264 seconds]
johnjaye has joined #commonlisp
cjrf has left #commonlisp [Killed buffer]
thonkpod has quit [Ping timeout: 264 seconds]
thonkpod has joined #commonlisp
RavenJoad has left #commonlisp [ERC 5.4 (IRC client for GNU Emacs 28.2)]
renatoathaydes has joined #commonlisp
renatoathaydes has quit [Ping timeout: 260 seconds]
cjrf has joined #commonlisp
notzmv has joined #commonlisp
cjrf has quit [Remote host closed the connection]
bilegeek_ has quit [Read error: Connection reset by peer]
bilegeek_ has joined #commonlisp
bilegeek__ has joined #commonlisp
bilegeek__ has quit [Read error: Connection reset by peer]
bilegeek__ has joined #commonlisp
bilegeek_ has quit [Ping timeout: 245 seconds]
bilegeek__ has quit [Ping timeout: 264 seconds]
JaguarKat has joined #commonlisp
akoana has quit [Quit: leaving]
JaguarKat has quit [Ping timeout: 260 seconds]
renatoathaydes has joined #commonlisp
notzmv has quit [Ping timeout: 260 seconds]
rainthree has joined #commonlisp
rainthree has quit [Ping timeout: 240 seconds]
lucasta has quit [Quit: Leaving]
rainthree has joined #commonlisp
slyrus has quit [Ping timeout: 260 seconds]
Oladon has quit [Quit: Leaving.]
habamax has joined #commonlisp
ronald has quit [Ping timeout: 240 seconds]
ronald has joined #commonlisp
dra has joined #commonlisp
dra has quit [Changing host]
dra has joined #commonlisp
notzmv has joined #commonlisp
renatoathaydes has quit [Ping timeout: 240 seconds]
renatoathaydes has joined #commonlisp
m5zs7k has quit [Ping timeout: 252 seconds]
m5zs7k has joined #commonlisp
attila_lendvai has joined #commonlisp
shka has joined #commonlisp
habamax has quit [Quit: ERC 5.5.0.29.1 (IRC client for GNU Emacs 29.0.92)]
renatoathaydes has quit [Ping timeout: 250 seconds]
renatoathaydes has joined #commonlisp
renatoathaydes has quit [Ping timeout: 240 seconds]
dipper has quit [Ping timeout: 240 seconds]
<jackdaniel> paulapatience: assuming slots by the mixin is fine if it is properly documented. even better if the mixin methods use accessors (not slots), then you may require that certain functions are specialized on the class
<jackdaniel> paulapatience: another option is to define these slots in the mixin - if the target class has slots of the same name then they will be "merged" into a single slot
renatoathaydes has joined #commonlisp
dipper has joined #commonlisp
rtypo has joined #commonlisp
attila_lendvai has quit [Ping timeout: 246 seconds]
msavoritias has joined #commonlisp
occ has quit [Ping timeout: 245 seconds]
dcb has quit [Quit: MSN Messenger 4.0.0]
rogersm has quit [Quit: Leaving...]
notzmv has quit [Ping timeout: 240 seconds]
azimut has quit [Ping timeout: 240 seconds]
renatoathaydes has quit [Ping timeout: 240 seconds]
renatoathaydes has joined #commonlisp
Gleefre has joined #commonlisp
cage has joined #commonlisp
dino_tutter has joined #commonlisp
Lord_of_Life_ has joined #commonlisp
Lord_of_Life has quit [Ping timeout: 264 seconds]
Lord_of_Life_ is now known as Lord_of_Life
renatoathaydes has quit [Remote host closed the connection]
renatoathaydes has joined #commonlisp
renatoathaydes has left #commonlisp [#commonlisp]
habamax has joined #commonlisp
soundmodel has joined #commonlisp
alcor has joined #commonlisp
soundmodel has quit [Quit: Client closed]
occ has joined #commonlisp
soundmodel has joined #commonlisp
McParen has joined #commonlisp
<McParen> does anyone know how to determine the "width" of a character when displayed on the screen? the width of ascii chars is 1, but many unicode chars are wider and cant be easily aligned
<McParen> their length in a string are still counted as 1, but they mostly take up more than one cell on the screen.
<beach> That would depend on the font.
<McParen> assuming "standard" terminal fonts?
soundmodel has quit [Client Quit]
<McParen> For example (length (princ-to-string (code-char #x2614))) => 1
<McParen> How can I get that to return 2, which is the "observed" width on screen.
<McParen> well, wrong, a better example would be #x1f60e, #\SMILING_FACE_WITH_SUNGLASSES
<cage> McParen: i tryed with wcswidth(3)
<cage> but with no luck :(
<beach> McParen: A string contains individual characters. So when you print a character to a string, it will occupy one element position.
<McParen> hi cage, trying that would be my plan B, I hoped that there is some lisp function that already does that.
<cage> hi McParen! :)
<beach> McParen: So the length of the string to which you have printed one character is always going to be 1.
<McParen> beach, i am aware of that. thats why i hoped that there is a "width" function equivalent to length, but which returns the width actually visible on a screen.
<beach> Such a function would have to be supplied with the font information. I suggest you check out McCLIM which has such functions.
<cage> McParen: i wish thre was a function too! :)
<cage> some more hints could be found from the elisp function 'string-width', perhaps
<McParen> beach: in a simple terminal output, the calling code would not be aware of the font used for outut.
<McParen> cage, i'll let you know if I find that out. "wide" unicode emojis are used so often nowadays, it is basically impossible to correctly wrap and align messages if the width cant be correctly determined.
<McParen> the ncurses author even suggests to simply print text containing wide chars to a non-displayed window, then calc the width from the cursor position, but that sounds like an awful hack.
<cage> McParen: thanks!
<cage> McParen: "the ncurses..." this could be the plan C :))
<cage> i agree it is a not so nice hack :)
<cage> McParen: i steppend into the same problem, because of emoji
<McParen> emacs (char-width ?😎) => correctly returns 2, basically this would be what i'm looking for, just for cl.
occ has quit [Ping timeout: 260 seconds]
igemnace has joined #commonlisp
notzmv has joined #commonlisp
notzmv has quit [Ping timeout: 260 seconds]
habamax has quit [Quit: ERC 5.5.0.29.1 (IRC client for GNU Emacs 29.0.92)]
habamax has joined #commonlisp
<McParen> sadly char-width it is not implemented in elisp, but in heavy macro-using C.. well.
shka has quit [Ping timeout: 250 seconds]
susam has left #commonlisp [#commonlisp]
rainthree has quit [Ping timeout: 250 seconds]
igemnace has quit [Remote host closed the connection]
<McParen> hey cage, i think i got wcwidth to corectly calc the width of emoji chars.
<McParen> wcwidth is a standard libc function, so it is always available, provided a cffi wrapper is added. seems to have worked for the few tests I've made.
<McParen> what it does not determine correctly are printed control chars like "^A", but that can be done manually.
gin41 has joined #commonlisp
gin41 has left #commonlisp [#commonlisp]
susam has joined #commonlisp
rtypo has quit [Ping timeout: 260 seconds]
igemnace has joined #commonlisp
Inline has joined #commonlisp
<cage> McParen: great!
<cage> i tried to wrap that functions some months ago but i guess i am just not good with FFI
<cage> McParen: looking forward to look at the code :)
<cage> does "^A" returns 0?
rainthree has joined #commonlisp
<McParen> cage: no, non-printable chars (control chars, newline) return -1.
<cage> this value makes sense to me, for non printable chars
random-nick has joined #commonlisp
msavoritias has quit [Remote host closed the connection]
tyson2 has joined #commonlisp
<pjb> (char-code (character "")) #| --> 1 |#
<pjb> (char-code (character "
<pjb> McParen: The "width" of a character when displayed on the screen depends on the font used to display the character. So you must use a function in your GUI that let you determine that. For example, if you used MCL (eg. MCLGUI), you would do: (font-codes-string-width "c" font-face-code mode-size-code). If you used Cocoa, you'd do: [@"c" sizeWithAttributes: [fontDescriptor fontAttributes]]
<cage> yes, but in this specific scenario the program uses a text terminal interface
<pjb> Oh, in that case, yes, ncurses has a function for that.
<cage> unfortunately seems that it does not :(
rtypo has joined #commonlisp
<cage> McParen had success wrapping wcwidth(3)
<pjb> Nice.
<cage> all merit to McParen :)
<pjb> It feel strange to use such characters on a terminal anyways…
<cage> it is useful for emoji and other characters of the same kind
<cage> for example you used the horizontal ellipsis and this character could benefit from a "stretch", so to say :)
<cage> it is a bit too short for my eyes :)
<pjb> :-)
McParen has quit [Remote host closed the connection]
McParen has joined #commonlisp
<McParen> pjb: double-width emojis are used often even here on libera. on other irc networks, theyre literally everywhere.
ezakimak has quit [Ping timeout: 250 seconds]
<McParen> most asian chars will likely also be double-width.
notzmv has joined #commonlisp
habamax has quit [Quit: ERC 5.5.0.29.1 (IRC client for GNU Emacs 29.0.92)]
habamax has joined #commonlisp
makomo has joined #commonlisp
<Nilby> It's a horrible mess. Unicode doesn't define it. wcwidth isn't always right. Emacs gets it wrong frequently. Sadly there is no way to be completely right because it depends on the terminal implementation and even what font you are using. ncurses author is correct saying the only way is to test in a given terminal set up, which is very annoying and time consuming.
<cage> iteresting!
<Nilby> even if wcwidth and the terminal match on a given system, you might be displaying in a terminal on a remote system which doesn't match.
<Nilby> oh, and they add seem to add emojis every day
dino_tutter has quit [Ping timeout: 250 seconds]
<Nilby> my opinion is unicode should define it, and publish it in yet another data file, which everything will have to periodically update to like heckin time zones
<cage> aren't the emoji define by unicode?
<Nilby> yes, but the widths in a terminal aren't
<pjb> Well, unicode doesn't impose a font, you could have a high res terminal with very packed emojis :-)
<pjb> and each emoji could have a different pixel width.
<pjb> proportional emojis!
<cage> yes, i guess the author of a font could just ignore the width recommended by unicode
<cage> if this is true i think the problem is difficult to solve :(
<Nilby> "normal" people don't care because they don't look at things in terminals or code. in non-fixed width world it's a given that you always have work it out with the font or even the display engine
<Nilby> you'd think that programmers that work in fixed width so much would work it out for themselves
<Nilby> Sorry for the rant. This has been driving me crazy for years.
<cage> i can undertand your feelings :)
<cage> text rendering is always hard, both in GUI and in TUI!
<bike> i would think that depending on how the rendering works the width of a character might not even be well-defined, since you can have characters combine into fancy digraphs and such things
<cage> yes, ligatures as well
<bike> oh yeah, that's the right word.
<Nilby> Terminals can't do that, so you'd think it would be easier, but no. Even in web things you have monospaced sections that you'd kind of expect to look like terminal. And even terminals rendered in browser engines are popular.
<cage> i think we all could agree that yes, it is a mess :-D
<habamax> some terminals are happy to render ligatures
<cage> even in GUI the width of a string is not a simple concept, IIRC, for example, in pango library there was something like "ink width", the bounding box that warp all the pixel of the rendered string and the string width that usually has a bigger area than the first
<cage> habamax: and emoji can be composed of more than one character too O_O
<cage> i mean more than one character that neesd to be rendered as a single one
<cage> *needs
<habamax> just tried st -- it can render some emojis
<ixelp> untitled - asciinema
<cage> habamax: is emacs29 that is able to group emoji the way you shown?
<habamax> yep
<cage> nice, thanks!
phantomics_ has quit [Quit: Leaving]
Inline has quit [Ping timeout: 260 seconds]
<habamax> ✌️
yottabyte has joined #commonlisp
<cage> 😃
vitovan has joined #commonlisp
<McParen> ⛵
<cage> :D :D :D
<McParen> reminds me of zawinski's law: "Every program attempts to expand until it can read mail. Those programs which cannot so expand are replaced by ones which can." but applied to emojis.
<McParen> at least theyre not animated. (yet.)
<cage> i have some code just to recognize if a character is an emoji and i can guarantee that is not exactly the most elegant code out there :)
<cage> McParen: yes, maybe in the future, who knows :)
<McParen> it is inevitable.
<McParen> i will refuse to die until i see small unicode sailboats sailing left to right in an terminal irc client and being chased by a unicode shark emoji.
<cage> there is blinking text already, with animated emoji terminal output will resemble webpage from the '90 :)
<cage> McParen: 🤣
habamax has quit [Quit: ERC 5.5.0.29.1 (IRC client for GNU Emacs 29.0.92)]
pve has joined #commonlisp
Oladon has joined #commonlisp
tibfulv has quit [Remote host closed the connection]
tibfulv has joined #commonlisp
ezakimak has joined #commonlisp
tetsuo9 has quit [Remote host closed the connection]
tetsuo9 has joined #commonlisp
JaguarKat has joined #commonlisp
susam has quit [Quit: ZNC 1.8.2+deb2+b1 - https://znc.in]
occ has joined #commonlisp
azimut has joined #commonlisp
<jcowan> Nilby: The EastAsianWidth table doesn't necessarily match duowidth fonts, but it's a good approximation. And with a few exceptions, Unicode releases annually.
vitovan has quit [Ping timeout: 250 seconds]
tetsuo9_ has joined #commonlisp
tetsuo9 has quit [Ping timeout: 260 seconds]
occ has quit [Ping timeout: 260 seconds]
Gleefre has quit [Remote host closed the connection]
Gleefre has joined #commonlisp
igemnace has quit [Remote host closed the connection]
azimut has quit [Ping timeout: 240 seconds]
dipper has quit [Ping timeout: 260 seconds]
Inline has joined #commonlisp
tyson2 has quit [Remote host closed the connection]
ronald has quit [Ping timeout: 260 seconds]
Inline has quit [Remote host closed the connection]
Inline has joined #commonlisp
Inline has quit [Read error: Connection reset by peer]
Inline has joined #commonlisp
rainthree has quit [Ping timeout: 250 seconds]
ronald has joined #commonlisp
Inline has quit [Excess Flood]
Inline has joined #commonlisp
Inline has quit [Read error: Connection reset by peer]
inline__ has joined #commonlisp
inline__ has quit [Read error: Connection reset by peer]
Oladon has quit [Quit: Leaving.]
soundmodel has joined #commonlisp
Inline has joined #commonlisp
dipper has joined #commonlisp
karlosz has quit [Quit: karlosz]
karlosz has joined #commonlisp
soundmodel has quit [Ping timeout: 246 seconds]
JaguarKat has quit [Remote host closed the connection]
slyrus has joined #commonlisp
azimut has joined #commonlisp
yottabyte has quit [Quit: Connection closed for inactivity]
vitovan has joined #commonlisp
vitovan has quit [Ping timeout: 260 seconds]
dtman34 has quit [Ping timeout: 260 seconds]
johnjaye has quit [Ping timeout: 250 seconds]
karlosz has quit [Quit: karlosz]
dtman34 has joined #commonlisp
johnjaye has joined #commonlisp
weird_error has joined #commonlisp
perrierjouet has quit [Quit: WeeChat 3.8]
perrierjouet has joined #commonlisp
perrierjouet has quit [Quit: WeeChat 3.8]
perrierjouet has joined #commonlisp
weird_error has quit [Remote host closed the connection]
weird_error has joined #commonlisp
dcb has joined #commonlisp
karlosz has joined #commonlisp
vitovan has joined #commonlisp
perrierjouet has quit [Quit: WeeChat 3.8]
vitovan has quit [Ping timeout: 250 seconds]
cjrf has joined #commonlisp
perrierjouet has joined #commonlisp
weird_error has quit [Ping timeout: 250 seconds]
dtman34 has quit [Ping timeout: 258 seconds]
tyson2 has joined #commonlisp
dtman34 has joined #commonlisp
Oladon has joined #commonlisp
tyson2 has quit [Ping timeout: 260 seconds]
thollief has joined #commonlisp
tyson2 has joined #commonlisp
<remexre> I just measure the wcwidth at runtime in my code 👀
<remexre> using \x1b[6n to get the column number
bollu has joined #commonlisp
<cage> I am learning a lot of things today!
dtman34 has quit [Ping timeout: 245 seconds]
cage has quit [Quit: rcirc on GNU Emacs 28.2]
tyson2 has quit [Remote host closed the connection]
waleee has joined #commonlisp
McParen has left #commonlisp [#commonlisp]
dtman34 has joined #commonlisp
attila_lendvai has joined #commonlisp
attila_lendvai_ has joined #commonlisp
attila_lendvai has quit [Ping timeout: 240 seconds]
weird_error has joined #commonlisp
bird_ has quit [Ping timeout: 264 seconds]
bird_ has joined #commonlisp
alendvai__ has joined #commonlisp
attila_lendvai_ has quit [Ping timeout: 264 seconds]
weird_error has quit [Ping timeout: 250 seconds]
alendvai__ has quit [Remote host closed the connection]
alendvai__ has joined #commonlisp
morganw has joined #commonlisp
rtypo has quit [Ping timeout: 264 seconds]
vitovan has joined #commonlisp
dtman34 has quit [Quit: ZNC 1.8.2+deb2+b1 - https://znc.in]
tyson2 has joined #commonlisp
rtypo has joined #commonlisp
vitovan has quit [Ping timeout: 260 seconds]
alendvai__ has quit [Ping timeout: 240 seconds]
attila_lendvai has joined #commonlisp
attila_lendvai has quit [Ping timeout: 250 seconds]
McParen has joined #commonlisp
McParen has quit [Ping timeout: 245 seconds]
mzan has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
mzan has joined #commonlisp
igemnace has joined #commonlisp
thollief has quit [Quit: Leaving]
mzan has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
mzan has joined #commonlisp
cjrf has quit [Remote host closed the connection]
csos95 has quit [Ping timeout: 245 seconds]
johnjaye has quit [Ping timeout: 240 seconds]
johnjaye has joined #commonlisp
rgherdt_ has joined #commonlisp
rgherdt has quit [Remote host closed the connection]
tyson2 has quit [Ping timeout: 264 seconds]
csos95 has joined #commonlisp
mzan has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
mzan has joined #commonlisp
Inline has quit [Ping timeout: 264 seconds]
csos95 has quit [Ping timeout: 260 seconds]
tyson2 has joined #commonlisp
akoana has joined #commonlisp
vitovan has joined #commonlisp
pve has quit [Quit: leaving]
vitovan has quit [Ping timeout: 260 seconds]
dino_tutter has joined #commonlisp
tyson2 has quit [Remote host closed the connection]
morganw has quit [Remote host closed the connection]
triffid has quit [Remote host closed the connection]
weird_error has joined #commonlisp
weird_error has quit [Remote host closed the connection]
Gleefre has quit [Remote host closed the connection]
azimut_ has joined #commonlisp
azimut has quit [Ping timeout: 240 seconds]
dino_tutter has quit [Ping timeout: 240 seconds]
karlosz has quit [Quit: karlosz]
ronald has quit [Ping timeout: 250 seconds]
ronald has joined #commonlisp
occ has joined #commonlisp
rgherdt_ has quit [Remote host closed the connection]
azimut_ has quit [Remote host closed the connection]
azimut has joined #commonlisp
dtman34 has joined #commonlisp
azimut has quit [Ping timeout: 240 seconds]
rtypo has quit [Ping timeout: 252 seconds]
vitovan has joined #commonlisp
vitovan has quit [Ping timeout: 260 seconds]
igemnace has quit [Remote host closed the connection]
tyson2 has joined #commonlisp
azimut has joined #commonlisp