freenode/#sicl - IRC Chatlog
Search
7:30:18
beach
But I keep thinking how close we are to extract at least part of Cleavir to a separate library.
7:31:36
beach
Once Clostrum is done, We can extract CST-to-AST, which then includes the AST definitions. To accomplish its task it would then use Eclector, CST, Trucler, Clostrum, and the CST-to-AST code.
7:32:09
beach
The only thing that needs to be decided is which part of the existing code counts as generally useful, and which part should be left as client configuration.
7:34:01
beach
In that extracted library, we could also supply default versions of some of the macros like DEFUN, DEFMACRO, and the simple ones like WHEN, UNLESS, etc.
9:38:33
jackdaniel
beach: what should we do with function-unbound? remove it from the specification or leave it be?
9:40:09
jackdaniel
OK, I think that its description should be clarified in that case, because based on the rest of the specification it is not clear, how the "client code can use the return value of this function to determine whether function-name is unbound"
9:41:22
beach
OK. How about, "if the value returned by this function is EQ to the CAR of the CONS cell returned by FUNCTION-CELL, then the function is unbound"?
9:42:30
jackdaniel
OK, I think that you've mentioned some change in the repository (I've suggested that you should pull first) – I don't see that change, so I suspect that you did not push
9:48:03
beach
Oh, and I would like to you keep the protocol system(s) and package(s) separate from those of the implementation. The idea is that a client might use the protocol, but with an implementation that is adapted to specific needs.
9:48:50
jackdaniel
there is a system clostrum, which contains the protocol, and clostrum/virtual for example implementation
9:49:20
jackdaniel
there are two packages in the system clostrum: clostrum and clostrum-implementation, first only exports symbols while the second one defines protocol classes and functions
9:54:19
jackdaniel
I think that a similar clarification should be made to a function variable-unbound
10:33:19
jackdaniel
I have a question after all. it is longer than one line, so I've pasted it: http://turtleware.eu/static/paste/fe810dee-function-inline.txt
10:35:20
jackdaniel
well, more a suspiction that function-inline specification is vague enough to allow undefined behavior
10:45:19
jackdaniel
(underlying assumption is that inline information is not stored with a function and that fdefinition does not modify that information because it is not specified to)
12:02:11
jackdaniel
the specification of (setf special-variable) has a typo, its lambda list is (value symbol environment init-p), it should be (value client environment symbol init-p) -- most notably it lacks client, but also the argument order is not consistent with other operators
12:08:55
jackdaniel
right, but should we preserve the inline information after the function-name becomes unbound?
12:09:04
beach
So when the compiler sees (defun f ...) it must be able to query the environment and get back INLINE so that it can save whatever information is necessary.
12:13:12
beach
But now I am thinking that we might need a way for the compiler to recover not only WHETHER the function is declared inline, but also the inline information associated with it.
12:15:02
jackdaniel
so it seems to indicate, that the proclamation applies to a function name, not a particular function
12:15:17
jackdaniel
in other words, there is nothing what would warrant removing such information when the function is undefined
12:15:50
beach
We define two more generic functions inline-information and (setf inline-information).
12:17:55
beach
And when the function is made undefined, the inline information is erased (NIL), but not the flag.
12:18:40
beach
If it returns INLINE, the compiler will then consult INLINE-INFORMATION, and use that information only if it is not NIL.
12:18:42
jackdaniel
and that new functions would belong to the run time environment? or to the compilation environment?
12:19:10
jackdaniel
the former I guess, because the function may be defined in a different compilation unit
12:22:27
beach
If, when the compiler sees (defun f ...), FUNCTION-INLINE returns INLINE, then the compiler must nevertheless save inline information (like an AST) about the function, so that it can be inlined when the compiler sees a call to f later on.
12:24:39
beach
It is possible that (setf function-inline) was invoked on the run-time environment completely outside of any compilation.
12:25:34
jackdaniel
can't the compiler use the compilation environment's parent to access that information?
12:25:38
beach
The information in the compilation environment must take priority over the one in the run-time environment.
12:26:38
jackdaniel
so in other words, both run-time environment and compilation environment participate in the inline-information protocol?
12:26:40
beach
Because if the compiler then sees (eval-when (:compile-toplevel) (defun g () .. (f ...))) then F would be inlined.
12:28:15
jackdaniel
but function-inline belongs only to run-time environment and that information is preserved across function redefinitions
12:31:22
jackdaniel
I agree; for now I'll leave it defined as it is shown in the paste above, in the meantime I'll also try to think about inlining
12:35:06
pjb
jackdaniel: Not really. Thinking is not always easy or automatic. Sometimes you have to apply yourself to it. And sometimes you're distracted from it, so it's hard.
12:48:05
jackdaniel
I have another question: using the function special-variable, how am I supposed to decide, whether the symbol is a special variable or not?
12:48:36
jackdaniel
consider i.e that I'm defining a special variable without a value, i.e (setf (special-variable client env 'my-symbol nil) nil)
12:49:43
jackdaniel
how is it different from calling (special-variable client env 'my-not-so-special-symbol) ;?
12:50:16
jackdaniel
beach: should I consult doubts like that or try to "fix" the specification on my own?
12:51:57
beach
Whatever it does to my context, it is important that we discuss those issues, do don't fix anything unless you are absolutely sure.
12:56:17
jackdaniel
I had a doubt if it should be the first value, but after a second of consideration it sounds right, because the primary value should not be nil if it is the special variable
12:56:48
jackdaniel
(and if that flag went as the third value, then this assertion could be invalid when there is no value or the value is nil)
12:57:15
beach
Yeah, and a compiler might want only the special/no-special information, so that should be first.
13:16:16
beach
Hello Bike. You might want to participate in the discussion about these scenarios that we are contemplating with jackdaniel.
13:17:17
beach
We haven't come up with many yet, but yes, you can check that we are on the right track if you have the time.
13:19:27
jackdaniel
I will be afk for ~1h, but before I do that I want to suggest one more operator: constant-variable-p
13:19:53
jackdaniel
the reader constant-variable signals an error if symbol does not denote a constant variable
13:20:52
jackdaniel
in principle that could be defined as (and (boundp symbol) (not (special-variable symbol)) (not (symbol-macro symbol))) -- pseudocode, but that would be quite harsh on the protocol user
13:21:20
jackdaniel
we could, but then we should change the specification, that (constant-variable …) signals an error when there is no such constant