phoe changed the topic of #lisp to: Common Lisp, the #1=(programmable . #1#) programming language | <http://cliki.net/> <https://irclog.tymoon.eu/freenode/%23lisp> <https://irclog.whitequark.org/lisp> <http://ccl.clozure.com/irc-logs/lisp/> | SBCL 1.4.16, CMUCL 21b, ECL 16.1.3, CCL 1.11.5, ABCL 1.5.0
libertyprime has quit [Ping timeout: 245 seconds]
xkapastel has quit [Quit: Connection closed for inactivity]
kajo has quit [Ping timeout: 257 seconds]
zhlyg has quit [Ping timeout: 246 seconds]
<aeth> I guess it would be (member :windows *features*) after loading trivial-features
<no-defun-allowed> look aeth, please don't make trivial-is-windows and put it on quicklisp
libertyprime has joined #lisp
<aeth> I mean, at least CL has the legitimate need for something like that. It's portability across implementations. It's just that it's done in trivial-features and not 10+ libraries each of one line per implementation
<pjb> What does the is-windows package do?
kajo has joined #lisp
<pjb> And why do they consider cygwin as windows???
elderK has quit [Ping timeout: 248 seconds]
<pjb> Clearly, you cannot use it, you have to write your own…
<pjb> But otherwise, yes, *features* https://cliki.net/Features
<pjb> #+win32
<aeth> well, trivial-features because e.g. some use :win32 and some use :windows https://github.com/trivial-features/trivial-features/
<aeth> I'm not sure why trivial-features decided to make them all standardize on :windows, not :win32, though
szmer has quit [Ping timeout: 248 seconds]
elderK has joined #lisp
<aeth> I'd think most of them already have :win32
<aeth> It looks like allegro uses :mswindows
pjb has quit [Remote host closed the connection]
abhixec has joined #lisp
dacoda has joined #lisp
buffergn0me has quit [Ping timeout: 248 seconds]
lucasb has quit [Quit: Connection closed for inactivity]
longshi has joined #lisp
orivej has quit [Ping timeout: 248 seconds]
q9929t has joined #lisp
q9929t has quit [Client Quit]
shangul is now known as olliy
olliy is now known as shangul
kajo has quit [Ping timeout: 248 seconds]
varjag has quit [Ping timeout: 245 seconds]
elderK has quit [Remote host closed the connection]
kajo has joined #lisp
ym555 has joined #lisp
kajo has quit [Ping timeout: 250 seconds]
dacoda has quit [Ping timeout: 248 seconds]
linli has joined #lisp
linli has quit [Read error: Connection reset by peer]
kajo has joined #lisp
ym555_ has joined #lisp
ym555 has quit [Ping timeout: 248 seconds]
elderK has joined #lisp
bexx has joined #lisp
longshi has quit [Ping timeout: 248 seconds]
kajo has quit [Ping timeout: 248 seconds]
Arcaelyx has quit [Read error: Connection reset by peer]
elderK has quit [Quit: WeeChat 1.9]
Jesin has quit [Quit: Leaving]
kajo has joined #lisp
Jesin has joined #lisp
<oni-on-ion> aeth, agh !
Arcaelyx has joined #lisp
zotan has quit [Ping timeout: 252 seconds]
zotan has joined #lisp
elderK has joined #lisp
paule32 has quit [Ping timeout: 248 seconds]
mathrick has quit [Ping timeout: 246 seconds]
libertyprime has quit [Ping timeout: 268 seconds]
elderK has quit [Read error: Connection reset by peer]
mathrick has joined #lisp
zotan has quit [Ping timeout: 252 seconds]
abhixec has quit [Quit: leaving]
defaultxr has quit [Ping timeout: 272 seconds]
zotan has joined #lisp
Lycurgus has quit [Quit: Exeunt]
zotan has quit [Ping timeout: 245 seconds]
zotan has joined #lisp
elderK has joined #lisp
bexx has quit [Remote host closed the connection]
torbo has joined #lisp
asarch has joined #lisp
<asarch> In HTML you could write: <meta charset="utf-8">, in net.html.generator:html you could: (:meta ...), however, how could you add the "chartset=utf-8" attribute to the tag?
techquila has quit [Ping timeout: 252 seconds]
dddddd has quit [Remote host closed the connection]
igemnace has quit [Quit: WeeChat 2.5]
<oni-on-ion> ahh i'm already lost ... https://www.cliki.net/HTML%20generator
<oni-on-ion> asarch, link to the lib you are using
<oni-on-ion> ?
kajo has quit [Ping timeout: 258 seconds]
kajo has joined #lisp
<asarch> htmlgen from OpenAllegro
<no-defun-allowed> Does ql:register-local-projects not recurse into directories to find systems for anyone else on CCL?
vutral has quit [Read error: Connection reset by peer]
<mgsk> sanit check please: An unbound slot is *not* the same thing as a slot being NIL right?
manualcrank has quit [Quit: WeeChat 1.9.1]
<no-defun-allowed> Yes, trying to read an unbound slot will signal a condition typically.
vutral has joined #lisp
abhixec has joined #lisp
<mgsk> no-defun-allowed: quicklisp + ccl + nested dirs works OK for me.
<no-defun-allowed> Weird.
libertyprime has joined #lisp
elderK has quit [Ping timeout: 272 seconds]
karlosz_ has joined #lisp
refpga has quit [Remote host closed the connection]
elderK has joined #lisp
<PuercoPop> asarch: In spinneret it would be (:meta :charset "utf-8" ...). I imagine it would be the same in htmlgen
<PuercoPop> the documentation of htmlgen says the attributes can be symbols or strings although they encourage keywords since "that looks more lisp like"
<beach> Good morning everyone!
nanoz has joined #lisp
montxero has joined #lisp
<asarch> (net.html.generator:html (:meta (:body (:p "Hello world!")))) -> <meta><body><p>Hello world!</p></body>
<asarch> <meta></meta> doesn't even exist! X-D
<montxero> asarch: hey
notzmv has quit [Ping timeout: 258 seconds]
notzmv has joined #lisp
pjb has joined #lisp
<PuercoPop> asarch: around you supposed to close meta before opening the body?
karlosz_ has quit [Quit: karlosz_]
<PuercoPop> Yeah, this works on my machine: (net.html.generator:html ((:meta :charset "utf-8") (:body (:p "hello world"))))
Lord_of_Life has quit [Ping timeout: 245 seconds]
nanoz has quit [Ping timeout: 246 seconds]
Lord_of_Life has joined #lisp
random-jellyfish has joined #lisp
<random-jellyfish> (defvar *board* '( (2 'black) 'empty 'empty 'empty 'empty (5 'white) 'empty (3 'white) 'empty 'empty 'empty (5 'black) (5 'white) 'empty 'empty 'empty (3'black) 'empty (5 'black) 'empty 'empty 'empty 'empty (2 'white) )) (defun nth-slot (idx color) (if (eq color 'black) (nth idx *board*) (nth (- 23 idx) *board*))) (defun slot-pieces (idx color) (let ((slot (nth-slot idx color))) (if (eq slot 'empty) 0 (first slot))))
<random-jellyfish> sorry
<random-jellyfish> no newlines there
<beach> And you should use a paste service for that much code.
<random-jellyfish> yeah, my bad
<random-jellyfish> the problem is that slot-pieces returns QUOTE instead of zero
<random-jellyfish> when the condition for zero is met
<random-jellyfish> and I don't understand why
<random-jellyfish> this is common lisp
<beach> Probably because you have nested quoted expressions.
<beach> random-jellyfish: This channel is dedicated to Common Lisp so it had better be Common Lisp.
<beach> A single quote before the first opening parenthesis is probably what you need.
shka_ has joined #lisp
<random-jellyfish> beach: which first opening parenthesis? from which function?
<beach> (defvar *board* '( <-- That one.
<beach> Why do you put quotes before BLACK, WHITE, and EMPTY?
<random-jellyfish> because I want them to be atoms
<random-jellyfish> can they be atoms without the quotes?
<beach> Quoting has nothing to do with anything being an atom.
<beach> It has to do with what is evaluated and what is not.
<random-jellyfish> I don't want them to be evaluated as functions
<beach> You need to study the rules of evaluation, and the definition of the special operator QUOTE.
<beach> Since they are already inside a QUOTE special form, as indicated by the outermost quote, they are not in a position to be evaluated.
<beach> You need to study the rules of evaluation, and the definition of the special operator QUOTE.
<beach> Besides, symbols are considered names of functions only (with a few exceptions) when they are the first element of a compound expression. which is not the case here.
<pjb> quoting has to do with what is evaluated and what is not ONLY in code, not in data!
<pjb> The only thing that quoting does is to read a list with two elements, the first one being CL:QUOTE.
<pjb> 'x is read as (CL:QUOTE x)
<pjb> That's all there is to it.
kajo has quit [Ping timeout: 248 seconds]
<pjb> (defvar *board* '((2 'black) 'empty) is read as (defvar *board* (CL:QUOTE ((2 (CL:QUOTE black)) (CL:QUOTE empty))))
<pjb> so you see that if you evaluate this form, the variable *board* will be bound, if previously unbound, to the list ((2 (CL:QUOTE black)) (CL:QUOTE empty))
<pjb> The second element of the first element of this list is a list of two elements: (CL:QUOTE black)
<random-jellyfish> I removed all the quotes from that list
<pjb> (first (second (first '((2 (CL:QUOTE black)) (CL:QUOTE empty))))) #| --> quote |#
<beach> random-jellyfish: Good, but did you understand why you should?
<random-jellyfish> I understand quote changes the mode of evaluation, it switches from form mode to data mode
<beach> As a first approximation, that probably works.
<random-jellyfish> at least that's what I read when I started learning lisp
<random-jellyfish> but if 'x is read as (CL:QUOTE x)
<random-jellyfish> it looks like a different story
<beach> It is not.
<random-jellyfish> I still get the same result with the quotes removed
<beach> random-jellyfish: As pjb said, when the READ function sees a ' character, it reads the expression that follows it, let say that expression is <expr>, then it returns (QUOTE <expr>).
torbo has quit [Remote host closed the connection]
<beach> random-jellyfish: Maybe you need to use DEFPARAMETER rather than DEFVAR.
<beach> clhs defvar
<asarch> YEAH!!!
<beach> random-jellyfish: As you see, DEFVAR does not change the value of the variable if it already has one.
<random-jellyfish> defparameter with a single quote before the first opening parenthesis? or no quotes at all?
<beach> *sigh*
<random-jellyfish> I know, I lack depth in my thinking...happens when you're tired
<beach> I suggest you get some rest then, then study the rules of evaluation in Common Lisp and then apply the new knowledge to your problem.
karlosz_ has joined #lisp
<random-jellyfish> defparameter with a single quote before the first opening par worked
<random-jellyfish> but I need to understand why
<beach> Indeed.
khisanth_ has quit [Ping timeout: 245 seconds]
<random-jellyfish> I noticed I understand better from analogies with other programming languages
<random-jellyfish> what is the difference between defvar and defparameter?
<random-jellyfish> ok so defvar can't change an existing variable
<beach> clhs defvar
<beach> Read the paragraph that starts "DEFPARAMETER unconditionally..."
<random-jellyfish> I was re-evaluating the same defvar every time I changed the code
<beach> Also read the description of the argument INITIAL-VALUE.
<random-jellyfish> yeah it's a form
<random-jellyfish> so it must be either quoted or have a valid function as first element
makomo has joined #lisp
<beach> Please stop it.
<beach> What is wrong with a variable, such as *trace-output* or *package*?
<beach> You really really need to study the rules of evaluation.
<beach> clhs 3.1.2.1
<makomo> morning
<beach> Hello makomo.
<makomo> hello :)
oni-on-ion has quit [Remote host closed the connection]
asarch has quit [Quit: Leaving]
karlosz_ has quit [Quit: karlosz_]
karlosz_ has joined #lisp
khisanth_ has joined #lisp
jansc has joined #lisp
<jansc> Hi! Is there a CL library for converting a relative URL to an absolute URL, given a base URL? I'm looking for something like urljoin in python: urljoin('http://mysite.com/foo/bar/x.html', '../../images/img.png') => 'http://mysite.com/images/img.png'. Seems like purl and quri don't support this.
mulk has quit [Ping timeout: 268 seconds]
varjag has joined #lisp
igemnace has joined #lisp
varjag has quit [Ping timeout: 248 seconds]
donotturnoff has joined #lisp
<jansc> Found it! (use-package :net.uri)
<jansc> (merge-uris (parse-uri "../../images/img.png") (parse-uri "http://mysite.com/foo/bar/x.html"))
<jansc> talking about it helped a lot ;)
<random-jellyfish> apparently talking helps more than reading :))
<random-jellyfish> beach: thanks for that link earlier on form evaluation, sheds more light over my ignorance
vlatkoB has joined #lisp
<beach> random-jellyfish: Oh, good.
<jansc> random-jellyfish: Yeah. I guess that's why Rubber Duck Debugging is a thing.
Arcaelyx has quit [Ping timeout: 252 seconds]
zotan has quit [Ping timeout: 245 seconds]
montxero has quit [Remote host closed the connection]
defaultxr has joined #lisp
zotan has joined #lisp
ludston has joined #lisp
<LdBeth> I think I find a way to emulate InterLisp’s [] pair in emacs
eschatologist has quit [Remote host closed the connection]
eschatologist has joined #lisp
shka_ has quit [Quit: Konversation terminated!]
karlosz_ has quit [Quit: karlosz_]
orivej has joined #lisp
shka_ has joined #lisp
donotturnoff has quit [Ping timeout: 245 seconds]
karlosz_ has joined #lisp
zhlyg has joined #lisp
kajo has joined #lisp
elderK has quit [Quit: WeeChat 1.9]
donotturnoff has joined #lisp
techquila has joined #lisp
uplime is now known as Rudolph
karlosz_ has quit [Quit: karlosz_]
mulk has joined #lisp
Rudolph has quit [Killed (dax (dont steal stuff from people u nerd))]
paul0 has quit [Ping timeout: 245 seconds]
uplime has joined #lisp
j`ey has left #lisp [#lisp]
donotturnoff has quit [Ping timeout: 248 seconds]
stux|RC has quit [Ping timeout: 252 seconds]
dale has quit [Quit: dale]
dddddd has joined #lisp
stux|RC has joined #lisp
wxie has joined #lisp
nanoz has joined #lisp
dmiles has quit [Ping timeout: 248 seconds]
ym555_ has quit [Ping timeout: 244 seconds]
kajo has quit [Ping timeout: 246 seconds]
dmiles has joined #lisp
kajo has joined #lisp
dddddd has quit [Ping timeout: 272 seconds]
dddddd has joined #lisp
random-nickname has joined #lisp
q3d has joined #lisp
dmiles has quit [Ping timeout: 245 seconds]
orivej has quit [Ping timeout: 258 seconds]
dmiles has joined #lisp
techquila has quit [Read error: Connection reset by peer]
simendsjo has joined #lisp
simendsjo has quit [Remote host closed the connection]
simendsjo has joined #lisp
kajo has quit [Ping timeout: 252 seconds]
kajo has joined #lisp
vhost- has quit [Ping timeout: 258 seconds]
kajo has quit [Ping timeout: 258 seconds]
kajo has joined #lisp
kajo has quit [Quit: From my rotting body, flowers shall grow and I am in them and that is eternity. -- E. M.]
kini has quit [Remote host closed the connection]
szmer has joined #lisp
flazh has quit [Ping timeout: 245 seconds]
orivej has joined #lisp
lnostdal has joined #lisp
dmiles has quit [Ping timeout: 245 seconds]
kini has joined #lisp
dmiles has joined #lisp
orivej has quit [Ping timeout: 245 seconds]
techquila has joined #lisp
defaultxr has quit [Ping timeout: 248 seconds]
polezaivsani has joined #lisp
flazh has joined #lisp
longshi has joined #lisp
Patzy has quit [Quit: WeeChat 2.4]
simendsjo has quit [Remote host closed the connection]
longshi has quit [Quit: WeeChat 2.4]
nanoz has quit [Ping timeout: 245 seconds]
lavaflow has quit [Ping timeout: 268 seconds]
ski has joined #lisp
makomo has quit [Ping timeout: 248 seconds]
nowhereman has joined #lisp
varjag has joined #lisp
lavaflow has joined #lisp
simendsjo has joined #lisp
jansc has quit [Ping timeout: 248 seconds]
akoana has left #lisp ["Leaving"]
makomo has joined #lisp
<LdBeth> Installed smartparens and I recall the reason last time I deleted that is I hate auto closing up parentheses which causes 1. hard to see how many parentheses I have to skip 2. REPL behavior annoying
<beach> What if [ were to insert a [ as usual, and then when you type the ], the [ turns into ( and the ] turns into as many ) as required to close to [?
<beach> Then the brackets would just be editor commands, and not present in the resulting code.
<LdBeth> beach: yes, that is exactly what I think, and can be implemented with emacs’ marker feature
simendsjo has quit [Ping timeout: 248 seconds]
wxie has quit [Quit: wxie]
<moldybits> LdBeth: what do you mean parentheses you have to skip?
simendsjo has joined #lisp
<moldybits> with smartparen ) at a closing paren will skip over it and highlight the opening paren so i know where i am.
<moldybits> personally, i couldn't stand using it until i discovered sp-forward-slurp-sexp.
techquila has quit [Remote host closed the connection]
jmercouris has joined #lisp
hiroaki has joined #lisp
lavaflow has quit [Ping timeout: 246 seconds]
FreeBirdLjj has joined #lisp
xkapastel has joined #lisp
<LdBeth> assume my cursor is |, now I have to skip unspecified number of ) to start a new sexp
<LdBeth> moldybits: (defun ... )|)))))
bobby has joined #lisp
<LdBeth> I’m using a config that auto pairs up when a ( is typed
<moldybits> i don't understand, where are all those )s from?
bobby has quit [Remote host closed the connection]
<LdBeth> So when I jut type (, there will be ()
<moldybits> yeah
<moldybits> but why would you have a bunch of ) after a defun?
<LdBeth> For example (let ((|)))
<LdBeth> And near the end of a function body it is normal to have five or six )s
<moldybits> (let ((x 42|))) then when i type )) it'll highlight the (( at the other end.
donotturnoff has joined #lisp
<LdBeth> But if it is (if a (let ((|))))
<LdBeth> That actually makes not difference from not auto pair parentheses
<LdBeth> Since I still have to take the same care which one match which, and types almost the same amount of )s
<LdBeth> And I don’t like having this feature in repl
<LdBeth> That’s why :P
<LdBeth> And I guess that’s the same reason scheme uses []
jmercouris has quit [Ping timeout: 268 seconds]
libertyprime has quit [Ping timeout: 258 seconds]
Inline has quit [Ping timeout: 252 seconds]
lavaflow has joined #lisp
lavaflow has quit [Ping timeout: 245 seconds]
libertyprime has joined #lisp
bobby has joined #lisp
rozenglass has joined #lisp
Inline has joined #lisp
Inline has quit [Read error: Connection reset by peer]
Inline has joined #lisp
lnostdal has quit [Ping timeout: 248 seconds]
jcowan has joined #lisp
Arcaelyx has joined #lisp
paule32 has joined #lisp
<paule32> hello
<paule32> i have problem with oop
simendsjo has quit [Remote host closed the connection]
ludston has quit [Ping timeout: 268 seconds]
<paule32> the question is, how can i use "powerDuraCell-AAA" in a "defun", to print :name
<paule32> ?
papachan has joined #lisp
v88m has quit [Ping timeout: 268 seconds]
<ski> LdBeth : s/Scheme/Racket/
<LdBeth> ski: actually, Chez Scheme allows that
<LdBeth> And what I remember is that is specified in R6RS
<ski> ok, ty
<LdBeth> paule32: u add ":reader what-ever-name" after ":initarg :name" and call "(what-ever-name powerFuraCell-AAA)" to access the name slot
<paule32> ah, ok, i found "slot-value"
q3d has quit [Ping timeout: 256 seconds]
<LdBeth> slot-value also works, but explicitly use reader often has merit of optimized speed
Lycurgus has joined #lisp
libertyprime has quit [Ping timeout: 258 seconds]
simendsjo has joined #lisp
random-jellyfish has quit [Ping timeout: 256 seconds]
libertyprime has joined #lisp
jmercouris has joined #lisp
cosimone has joined #lisp
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #lisp
FreeBirdLjj has quit [Ping timeout: 245 seconds]
lavaflow has joined #lisp
<szmer> is there a way to get in SLIME/SBCL the version of a definition with purposes of variables like #:G8 visible? I already have optimize debug 3 declaimed, macroexpands don't do this
jmercouris has quit [Ping timeout: 258 seconds]
bobby has quit [Quit: bye bye]
FreeBirdLjj has joined #lisp
FreeBirdLjj has quit [Ping timeout: 272 seconds]
Oladon has joined #lisp
<beach> szmer: There may not be any particular "purpose" other than "temporary variable".
<beach> szmer: I don't know the internals of SBCL, but that's the kind of thing that a typical compiler would generate for intermediate results that are not explicit in the source code.
<beach> szmer: ... like if you have (f (g x)), the compiler may generate code such as (setq #:G234 (g x)) (setq #:G345 (f #:G234))
rippa has joined #lisp
karlosz_ has joined #lisp
<szmer> beach: but this http://www.sbcl.org/manual/#The-Processing-Path suggests that some representation like this should exists somewhere
another-user has joined #lisp
<another-user> hi
nanoz has joined #lisp
<another-user> where can i find list of all functions operating on trees like subst? iirc clhs had something like this but can't find it now
<jcowan> FWIW, I don't avoid the use of `list` as a local variable in Scheme, as there is absolutely no need to do so unless I am going to call the standard `list` procedure within the lexical scope of the variable. That said, outside list libraries, it's usually better to call something foo-list to indicate that it has foos in it.
<jcowan> This supposed advantage of Lisp-2s is really not much of an advantage. (There are others.)
karlosz_ has quit [Quit: karlosz_]
<edgar-rft> another-user: you probably are looking for Chapter 14.2 The Conses Dictionary, e.g. here http://www.lispworks.com/documentation/lw50/CLHS/Body/c_conses.htm
lucasb has joined #lisp
<aeth> jcowan: I think you might underestimate how often this shows up in CL because you're used to Scheme. Separate class/type namespace is arguably as important as the other two, e.g. (check-type list list)
karlosz_ has joined #lisp
<jcowan> Good point.
<aeth> jcowan: And (check-type list list) is a bad example because a list often isn't a good name for a list. But foo is often a good name for a foo.
<aeth> I guess the Scheme solution here would be to call it a Foo instead of a foo?
<aeth> That's something you can't do in CL.
<jcowan> Since types are not standardized, there are various approaches to naming them. As I noted on #scheme, I write <foo> for a record-type, reserving foo for the constructor of immutable records and make-foo for the constructor of mutable ones.
<jcowan> I haven't seen that approach used, perhaps because case-blind Schemes still exist.
<jcowan> s/that/the UpperCamelCase
karlosz_ has quit [Client Quit]
<another-user> edgar-rft: that's it, thank you!
another-user has quit [Quit: WeeChat 2.5]
hiroaki has quit [Ping timeout: 246 seconds]
<aeth> (In anticipation of being pinged 5 hours from now, yes, you can technically have a class named |Foo| in CL. No, you shouldn't do that and I think anyone who reviews pull requests on Github/Gitlab/etc. would fail such code.)
<aeth> (Unless it's some really niche case that's interacting with foreign code or a database or something.)
nanoz has quit [Ping timeout: 244 seconds]
v88m has joined #lisp
FreeBirdLjj has joined #lisp
torbo has joined #lisp
papachan has quit [Quit: Saliendo]
FreeBirdLjj has quit [Remote host closed the connection]
kajo has joined #lisp
Lord_of_Life has quit [Ping timeout: 258 seconds]
FreeBirdLjj has joined #lisp
Lord_of_Life has joined #lisp
FreeBirdLjj has quit [Remote host closed the connection]
dmiles has quit [Read error: Connection reset by peer]
kajo has quit [Quit: From my rotting body, flowers shall grow and I am in them and that is eternity. -- E. M.]
optikalmouse has joined #lisp
kajo has joined #lisp
optikalmouse has quit [Client Quit]
nanoz has joined #lisp
dmiles has joined #lisp
karlosz_ has joined #lisp
Jesin has quit [Quit: Leaving]
Lycurgus has quit [Quit: Exeunt]
Jesin has joined #lisp
<mgsk> I have some slot that has :TYPE SIMPLE-VECTOR. On SBCL, if I try to initialize that slot with (make-array 0 :adjustable t :fill-point 0) (i.e. *not* simple), it works fine. On CCL however it does not, raising a type error. Is this behaviour (by the standard) implementation dependent? Obviously I should reconsider whether my type should by SIMPLE-VECTOR, but that's not my question.
<phoe> mgsk: SBCL ignores these type declarations for typechecking purposes.
<phoe> You can make a slot with :TYPE NUMBER and put a symbol there.
<mgsk> u wot
<phoe> ...oh wait a second...
<mgsk> phoe: Can you elaborate on why SBCL does this? Also does the standard not require that type info is respected?
<phoe> It used not to do that
<phoe> I'm confused now - don't mind me
<aeth> phoe: If (debug 3) is enabled it will check
<phoe> aeth: got it
<mgsk> I don't :(
<aeth> mgsk: It's a terrible antifeature and other implementations might behave similarly. To get around this, you have to use the metaobject protocol. I do so here: https://gitlab.com/zombie-raptor/zombie-raptor/blob/85c0f38945d44dd0f6984a5db53ca8dbfbd875ff/util/metaobject.lisp
<mgsk> aeth: which part is a terrible antifeature? That SBCL does or doesn't always respect :type?
<aeth> You could also wrap the defclass in a (debug 3) declaration, but that could have other effects, and it wouldn't fix this behavior on other implementations that might behave differently and never check :type
<aeth> mgsk: It's terrible that it has the capability to check type in a defclass slot, but doesn't normally do it. Especially since it's the most reliable implementation for defstruct typechecking.
<mgsk> aeth: I'm guessing it chooses not to typecheck for efficiency's sake? i.e. if you want type checking, you have to opt-in to the run-time slow down?
cosimone has quit [Quit: WeeChat 2.4]
<aeth> but the only reason to put :type is if you want it to be checked imo
<aeth> maybe don't check with (safety 0) and that's in line with the rest of the compiler
<aeth> SBCL singlehandedly makes people reimplement a(n apparently optional) part of the standard because the default settings on the most popular implementation (SBCL) don't respect :type
<mgsk> Damn. And I was getting along so well with SBCL
<mgsk> ty for the info aeth, phoe
<phoe> if the standard doesn't define something then define it yourself
<phoe> use the MOP for that just like aeth linked
<aeth> SBCL is normally the implementation to use if you want type information to be respected in a reasonable way, like in structs, declarations, etc. Pretty much everywhere except defclass
<aeth> But it focuses on types-for-efficiency, which is why they probably don't care with defclass slots
<mgsk> defclass is inefficient?
<aeth> Absolutely.
<aeth> It's incredibly dynamic.
<phoe> CLOS is a runtime object system with a lot of parts that are always modifiable
dmiles has quit [Read error: Connection reset by peer]
<phoe> that's why it's flexible and bendy
<phoe> but also why some things simply cannot be optimized away into simple pointer lookups and such
<aeth> defstruct is often implemented like defclass, but with redefinition restrictions so things like slot access via accessors can be inlined. The catch is that this means that in some implementations you can't redefine defstruct, which hurts the typical CL interactive workflow. You also can't afaik fix things via the MOP, like you can do with defclass.
themsay has quit [Read error: Connection reset by peer]
<aeth> define-condition also exists, for the condition system. So CL kind of has three class systems afaik.
themsay has joined #lisp
pjb is now known as Guest14704
pjb has joined #lisp
random-nickname is now known as random-nick
<shka_> yo
<shka_> is it acceptable to call positions in the arrays "pointers"?
<aeth> the standard has fill-pointer
<shka_> i think yes because fill-pointer term already exists
<shka_> aeth: so you agree?
<aeth> I would call it index, though
<aeth> position could also work, but that's trickier since it might conflict with the standard function POSITION
<aeth> (depending on how you're using it)
<shka_> i want to call it a pointer because it is index in the array acting as a data heap
<shka_> so it kinda is a pointer, conceptually
<phoe> smells like indices to me
<phoe> but then again, if you just allocate an artificial chunk of raw memory, then you effectively have pointers
<aeth> shka_: It's only acting like a pointer if it's an array that has an element-type whose upgraded-array-element-type isn't T
<phoe> aeth: he doesn't mean that
<phoe> he means that he's allocated an array that serves like a virtual RAM for him
<phoe> that's what I read
<aeth> well, with T then it's acting like a pointer to a pointer.
<paule32> hello
<paule32> i have a problem/question about variable storage
<paule32> in the paste above, there is a instance "cdraht" from class "draht"
themsay has quit [Ping timeout: 248 seconds]
<paule32> the question is: how can i store cdraht so, that it lives over method process
<phoe> Method process? What do you mean?
<paule32> over the calling scope
<phoe> just return it from the function, and you will have access to it
<paule32> yes, and next call, i have to give the address, that must be stored...
<phoe> Address? What address?
<paule32> object address
<paule32> the things:
<shka_> aeth: it is fixnum actually
<paule32> draht is translated english: wire
<paule32> len ist the length of the wire
<paule32> rs is a component that can be plugged at end of wire
Jesin has quit [Quit: Leaving]
<phoe> paule32: instead of setting a global variable CDRAHT, use a local variable, and return the object.
<phoe> (let ((draht ...)) ... draht)
<paule32> (powerDuraCell-AAA (draht-Cu1600 5 (draht-Cu1600 5 0)) (draht-Cu1600 5 0))
<paule32> 0 means, no component added/plugged
<paule32> component can be a "wire" or 0 für nothing, or not plugged/added
<phoe> I don't know how to help you. After all these months, you still to seem not to even try to write idiomatic Lisp.
<phoe> Or to even use basic concepts like lexical variables.
<paule32> ah ii understand - may be, (return-from draht-Cu1600 1) is direct context of the methode
dmiles has joined #lisp
<paule32> (defvar draht-1 (draht-Cu1600 2 0))
<paule32> is for variable context
<paule32> ?
<paule32> then i can return object, yes, right
<paule32> or?
Jesin has joined #lisp
torbo has quit [Remote host closed the connection]
<paule32> ok, i return the class ref. object in "draht-Cu1600"
<paule32> in method: (defmethod powerDuraCell-AAA (c1 c2)
<paule32> also c1, and c2
<paule32> how can i get the right object type?
<paule32> because, not only "draht-Cu1600" can be dock to dura cell power
<paule32> ah, type-of, class-of ...
<paule32> hehe, nice
dacoda has joined #lisp
gxt has joined #lisp
themsay has joined #lisp
simendsjo has quit [Ping timeout: 248 seconds]
lucasb has quit [Quit: Connection closed for inactivity]
anewuser has joined #lisp
dacoda has quit [Ping timeout: 248 seconds]
karlosz_ has quit [Quit: karlosz_]
t58 has joined #lisp
cosimone has joined #lisp
rozenglass has quit [Read error: Connection reset by peer]
nanoz has quit [Ping timeout: 248 seconds]
nowhere_man has joined #lisp
nowhereman has quit [Ping timeout: 258 seconds]
<paule32> so, next problem: http://dpaste.com/1PY93WA
<paule32> i get CLASS_NULL
<paule32> i expect th overgiven class rs
<ck_> phoe: this has been going on for _months_? I'm impressed
oni-on-ion has joined #lisp
<paule32> ck_: no, i don't spent all my time in lisp
<paule32> ck_: the other lispers here think, it
<paule32> ck_: and, they are don't realize it, that i have a dissadvantage
<ck_> Oh, ok. I didn't realize when we last talked that the secret to getting a response is to not address you directly.
<ck_> You'll probably get the hang of it someday. Good luck!
<paule32> ck_: don't be worry, my mother language is not english, so i have translate it when read + write, and so missunderstandings go on...
<paule32> your channel here claim that the nobbies understand all facts of programming
<paule32> that can i don't understand
guna has quit [Quit: ZNC 1.7.3 - https://znc.in]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
orivej has joined #lisp
<mgsk> Any ideas as to why (bt:destroy-thread *thread*) (print (bt:thread-alive-p *thread*)) => T ?
<mgsk> Even if I stick a lengthy sleep in there, thread-alive-p is T.
elderK has joined #lisp
ted_wroclaw has joined #lisp
dacoda has joined #lisp
random-nick has quit [Read error: Connection reset by peer]
<moldybits> paule32: #clschool is for newbies
<paule32> thx moldybits
<paule32> i kicked, and banned
ym555_ has joined #lisp
<pjb> mgsk: you cannot kill yourself.
<shka_> don't actually check the above
<mgsk> pjb: is that a challenge
<pjb> mgsk: (defun destroy-thread (thread)
<pjb> (ccl:process-kill thread))
<pjb> (signal-error-if-current-thread thread)
<shka_> anyway, it is true though that threads can't suicide
<shka_> code above should signal error IMHO
<mgsk> I don't understand. *thread* is something returned by bt:make-thread. Why wouldn't bt:destroy-thread accept that (and also do what its name suggests)?
<shka_> it accepts, but consider where are you executing said code
<shka_> what bt:destroy-thread will return?
<elderK> Moin all!
<mgsk> I'm not calling bt:destroy-thread from within the thread described by *thread*.
<shka_> oh
<shka_> ok
<shka_> mgsk: sbcl on linux or something different?
<mgsk> ccl on macos
<mgsk> sbcl works fine
<shka_> i see
<shka_> maybe ccl people can help, i am to poor for mac
<mgsk> shka_: ty for trying :)
<pjb> in ccl, (defparameter *thread* (bt:make-thread (lambda () (sleep 100000) 42))) (bt:destroy-thread *thread*) (bt:thread-alive-p *thread*) -> NIL
<mgsk> 100000 feels like a long time to wait
EuAndreh[m] has joined #lisp
nowhere_man has quit [Ping timeout: 272 seconds]
karlosz_ has joined #lisp
random-nick has joined #lisp
rozenglass has joined #lisp
karlosz_ has quit [Quit: karlosz_]
defaultxr has joined #lisp
<mgsk> pjb: I think I'm starting to understand what is happening. (bt:destroy-thread *thread*) (loop :while (bt:thread-alive-p *thread)) (print (bt:thread-alive-p *thread*)) => NIL
<mgsk> If I replace that loop with a (sleep 10), then the above is T.
<mgsk> So is SLEEP pausing *thread* also?
<mgsk> i.e. everything is paused, *thread* doesn't have chance to terminate.
igemnace has quit [Quit: WeeChat 2.5]
ted_wroclaw has quit [Quit: Textual IRC Client: www.textualapp.com]
shka_ has quit [Ping timeout: 248 seconds]
orivej has quit [Ping timeout: 248 seconds]
donotturnoff has quit [Ping timeout: 248 seconds]
flazh has quit [Ping timeout: 272 seconds]
Blkt has quit [Ping timeout: 252 seconds]
fe[nl]ix has quit [Ping timeout: 252 seconds]
Blkt has joined #lisp
fe[nl]ix has joined #lisp
elderK has quit [Quit: WeeChat 1.9]
elderK has joined #lisp
bugrum has joined #lisp
dale has joined #lisp
vlatkoB has quit [Remote host closed the connection]
anewuser has quit [Ping timeout: 258 seconds]
dacoda has quit [Remote host closed the connection]
dacoda has joined #lisp
cosimone has quit [Quit: WeeChat 2.4]
dacoda has quit [Ping timeout: 250 seconds]
lavaflow_ has joined #lisp
lavaflow has quit [Ping timeout: 248 seconds]
random-nick has quit [Ping timeout: 272 seconds]
zhlyg has quit [Ping timeout: 244 seconds]
t58 has quit [Read error: Connection reset by peer]
nolanv has joined #lisp
nowhere_man has joined #lisp
lavaflow has joined #lisp
lavaflow_ has quit [Ping timeout: 246 seconds]
wusticality has joined #lisp
ltriant has joined #lisp
polezaivsani has quit [Quit: ERC (IRC client for Emacs 26.2)]
lokian has joined #lisp
lokian has quit [Quit: leaving]
jeosol has joined #lisp
varjag has quit [Quit: ERC (IRC client for Emacs 26.1)]
Arcaelyx_ has joined #lisp
Arcaelyx has quit [Ping timeout: 248 seconds]
lavaflow_ has joined #lisp
lavaflow has quit [Ping timeout: 248 seconds]
guna has joined #lisp
karlosz_ has joined #lisp
lavaflow has joined #lisp
lavaflow_ has quit [Ping timeout: 272 seconds]
asarch has joined #lisp
<asarch> How would you print the <!DOCTYPE html> with net.html.generator:html?
karlosz_ has quit [Quit: karlosz_]
alexanderbarbosa has joined #lisp
<no-defun-allowed> In CL-WHO, it's printed if you give the WHO macro :prologue t from memory, maybe there is something like that?
wigust has joined #lisp
szmer has quit [Ping timeout: 272 seconds]
wigust- has quit [Ping timeout: 248 seconds]
quazimodo has joined #lisp
elderK has quit [Ping timeout: 248 seconds]
lavaflow1 has joined #lisp
lavaflow has quit [Read error: Connection reset by peer]
elderK has joined #lisp
techquila has joined #lisp