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