libera/#commonlisp - IRC Chatlog
Search
7:22:22
beach
It means that you defined a function RENAME when you were in the COMMON-LISP-USER package, and that package imports the symbol SB-EXT:RENAME.
7:22:51
beach
Furthermore, the package SB-EXT has a "package lock" on it, so you are not allowed to do that.
7:23:12
beach
You should not use the COMMON-LISP-USER package to define your own stuff. Define your own package.
7:24:50
beach
You don't have to. If you define your own package and define RENAME in it, the problem goes away.
7:26:01
beach
(defpackage #:my-package (:use #:common-lisp)) (in-package #:my-package) (defun rename ...)
7:28:33
tourjin
I mean if somewhere in sb-ext there already rename function defined i'd like to see what it is. ...oh ok i type in commonlisp channel again. i'll ask things on clschool channel. thank you. Mr. beach
7:29:26
beach
tourjin: There are probably thousands of functions in various packages in the SBCL system. You can't possibly know them all.
7:32:34
beach
In the version of SBCL that I have, there is not function RENAME in the SB-EXT package. Just a symbol by that name.
7:49:37
tourjin
can you help me again? after trying defpackage #:my-package everythings gone. how can I go back to :sb-ext environment?
12:33:49
nij-
gilberth - One thing you may care (no hurries though): Aproposing "*" in novaspec doesn't work currently.
12:39:12
nij-
Question: LABELS defines local bindings to functions. How about local bindings to closures? Something like (lables_ext ((let ((x 7)) (cls () x)))) ?
12:41:39
nij-
Yeah.. but that's not "local" enough. Say in labels I have 5 local bindings, but that (x 7) is only required in the first local binding..
12:43:40
paulapatience
Depending on what you intend to do, you could make lambdas and call serapeum:fbind
12:47:41
nij-
bike I think that's just a matter of style and expressiveness. (let ..) is so useful because it allows me to know that such binding definitely only works here (lexically). In this aspect, the more localized the let form, the better and clearer.
12:50:35
nij-
Question: What does "initialize" mean in 15.2? https://novaspec.org/cl/f_make-array -- I thought it just meant "populate", but that way I can't understand the sentence:
12:50:45
nij-
> "If initial-element is not supplied, the consequences of later reading an uninitialized element of new-array are undefined unless either initial-contents is supplied or displaced-to is non-nil."
12:53:00
bike
implementations will probably initialize it to something or another, since raw uninitialized memory could be something very weird and screw up the GC
12:53:04
nij-
"uninitialized element" is not a good way to formulate.. it means something different.
13:01:58
nij-
It may mean that the element itself in a slot of an array has at least two states: initialized and uninitialized.
13:06:15
scymtym
yes. and reading an element that is in the uninitialized state results in undefined consequences, typically an implementation-dependent value is returned. you seem to think that way this is specified is not good rather than the behavior itself?
13:09:10
mrcom
nij: If the programmer wishes CL to automatically ensure all elements have a know value, said programmer uses the :INITIAL-ELEMENT keyword.
13:10:36
mrcom
If programmer decides "I'm about to load everything anyway, no point wasting CPU/memory that's just going to be thrown away", then programmer does *not* use :INITIAL-ELEMENT.
13:13:26
mrcom
(Although it's better practice to explicitly set it to something like 0 or NIL. Those are atoms and won't allocate memory, and as bike said the language is probablly going to set it *something* anyway.)
13:14:03
nij-
would be better if the standard writes "the consequences of later reading an uninitialized slot" instead of "uninitialized element".
13:15:10
nij-
15.1.1 "An array contains a set of objects called elements that can be referenced individually according to a rectilinear coordinate system."
13:17:18
mrcom
"Uninitialized" means "no telling what exact value you'll get. It depends upon the implementation."
13:18:05
mrcom
For example, unitialized elements in a bit array might really, truly be whatever garbage was already in memory there.
13:18:57
nij-
I know what it really means. I just don't think that "uninitialized element" nor "uninitialized object" is a good way to express it, given 15.1.1.
13:19:01
mrcom
Technically, an unitialized object might be of any type. So the first element might be a fixnum 42. The second a null.
13:20:01
mrcom
I think this is a mindset thing; it hasn't really clicked with you and been internalized.
13:20:36
nij-
Yeah possibly. The spec is written in English, which is not my native lang, and also even if it were people understand it differently.
13:21:45
mrcom
You can have an array where the first element is a fixnum, the second a string, and the third a CONS cell.
13:22:33
mrcom
It *doesn't*. That's the point. The standard is specifically saying "no telling what you'll get if you look at it before you've put something specific there."
13:25:25
nij-
I see. I guess you are correct. There's not really a definition for the term "object" in the standard. The closest is https://www.lispworks.com/documentation/HyperSpec/Body/26_glo_o.htm#object , which says that an object is just any Lisp datum. But it doesn't define what a Lisp datum, iirc.
13:25:32
mrcom
Even when you tell CL that you want an array to only contain, say, floating point numbers (:ELEMENT-TYPE 'FLOAT), that's kind of just a hint.
13:26:26
mrcom
You're kind of asking "the standard says that an object is any kind of thing. What's the definition of 'thing'?"
13:27:38
mrcom
That's part of the mind set. It will click, and you're brain will go "ohhh! any 'thing' is *any* thing."
13:33:30
beach
mrcom: Please don't repeat that in Common Lisp "everything is an object" because it just isn't so.
13:35:39
beach
nij-: By a "datum" it means anything that can be the value of a variable, that can be passed as an argument to a function call, and that can be returned as the value of a function call.
13:36:49
scymtym
i think the question of an "undefined object" doesn't come into play, at least in this context, since the consequences of "reading an uninitialized element of new-array" are already undefined. the operator, for example AREF, doesn't have to return anything at alla. the implementation could just crash
13:37:21
beach
nij-: You are absolutely right. There should be a distinction between "element" as a placeholder of an object and the object contained in that placeholder.
13:38:06
beach
It is the placeholder that may be uninitialized, meaning it does not necessarily contain a valid object.
13:41:13
nij-
But I think what it really means would have been much clearer if they defined "a placeholder" notion in the array. Alas that's not mentioned either.
13:41:52
scymtym
https://novaspec.org/cl/26_1_Glossary#access and https://novaspec.org/cl/t_cell-error could be relevant
13:45:48
beach
Well, I just defined it as "anything that can be...", but then you need to define "thing".
13:45:50
nij-
scymtym Thanks! In #access, it links to #element, which says explicitly "2. [an element] (of an array) an object that is stored in the array."
13:47:46
scymtym
nij-: sure. i'm just pointing out related concepts since you said you wanted to write up an issue. CELL-ERROR talks about "location access" which seems like a good phrasing of the operation that triggres the undefined consequences in the contet of MAKE-ARRAY
13:55:53
nij-
! Any place that documents which X3J13 issues are in the standard, and which are not?!
13:57:24
beach
I also said that the Common Lisp HyperSpec is for all practical purposes the same as the standard.
13:59:24
nij-
"These issue writeups, while not part of the Common Lisp specification, are nevertheless useful for understanding original intent." http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/FrontMatter/X3J13-Issues.html
14:00:00
bike
when you file a bug on github, and the bug gets fixed, you don't just incorporate the text of the issue into your program
14:00:22
bike
the issue says "hey, let's fix X by doing Y in the standard" and then Y ends up in the standard
14:01:43
mrcom
nij: Unfortunately, there are only two ways (that I can think of) to define something: either a) equate it to some other classification term, hopefully one you're familiar with :)
14:02:55
mrcom
"Datum", unfortunately, isn't a classification term that is widely used. I think that's probablly why the spec uses it; "thing" would be
14:03:25
mrcom
just too widely encompassing. As beach pointed out, stuff he considered "things" aren't datums.
14:04:01
mrcom
"places" are a really good example of a Lisp "thingy" that's not a datum, and so isn't an object.
14:05:14
dlowe
If I heard someone talking about CL objects I would assume CLOS objects, and by that measure not everything in CL is an object.
14:05:31
dlowe
If you cite the glossary I invite you to stuff it up your linguistic prescriptiveness
14:06:00
mrcom
dlowe: that's true, too, but only because other languages define "object" as an instance of a class. But it's a *really* common internalization.
14:06:57
nij-
bike I'm a bit confused here. So, this x3j13 issue approves the macro nth-value to be added into the standard. http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/Issues/iss250-writeup.html
14:10:53
bike
nij-: i don't know or care about differences between the standard, dpans, and CLHS. i just use the CLHS.
14:12:29
scymtym
nij-: x3j13 issues typically suggest one or more changes to the standard which are written up with supporting information like a description of the background, pros and cons of the proposed changes, etc. if one of the proposals has been accepted, the proposed change is now part of the standard, not the issue itself
14:15:12
dlowe
nij-: language is used as a medium of both communication and specification, and I was speaking in the former mode.
14:19:40
scymtym
nij-: in the sense that dpans is the basis for wscl, i care about improvements that are present in the standard or clhs but not dpans. i haven't seen many of those if any so far. in particular, i don't think any x3j13 issues have been "applied" in the standard but not in dpans
14:20:39
gilberth
nij-: Indeed. This is on purpose. You need to type at least three chars iirc. This apropos interface is not obvious though. You can type e.g. "+ fun" or "+ va". Or e.g. "mu bind". Also it lacks keyboard navigation. Thanks for noting!
14:22:29
beach
I would also be interested in finding an X3J13 issue that was not approved, but is listed in the Common Lisp HyperSpec.
14:24:54
beach
nij-: Yes, but it would prove my point that those issues are not related to any difference between the Common Lisp HyperSpec and the standard.
14:24:56
mrcom
nij-: beach *is* a language lawyer, by choice and profession. Which is an important thing for the ecosystem. Without procesion we would have Perl. Or YAML.