freenode/#lisp - IRC Chatlog
Search
7:31:49
schweers
Can somebody explain to me why this function works as intended in SBCL, but not in CCL? https://pastebin.com/nkQfGV9Y
7:32:17
schweers
CCL claims this: File #P"/proc/7377/fd/0" does not exist. [Condition of type CCL::SIMPLE-FILE-ERROR]
7:32:57
schweers
This is the first time I’m using wildcards and the function DIRECTORY, so I might be missing something really obvious.
8:04:52
afidegnum
yes, but via live conference will give an ample room to follow the coding process, and ask questions,
8:08:04
moldybits
this is just a thought but ... it could be interesting to pick a topic to be discussed, with perhaps some texts are suggested reading. preferably something where it's not necessary to read them to be able to participate meaningfully in the discussion ...
8:22:55
beach
afidegnum: You are asking people to invest a lot of work in order to help others learn Common Lisp. Most people here have full-time work or other occupations. And the people here are here for various reasons, but not mainly to help others learn Common Lisp. For that, there i #clschool.
8:29:49
beach
I am just explaining why you will likely find only very limited enthusiasm for your suggestion. But I hope you will succeed. I will personally not participate.
8:38:43
moldybits
and it's not obvious to me that enthusiasm couldn't happen, but it'd require more than an impulsive idea
15:56:09
Xach
trafaret1: the following form is evaluated at read time and the return value is used as the result from the reader.
15:57:59
Xach
many read macros start with #, are optionally followed by a numeric argument, and concluded with a single character that is associated with the behavior. #+, #-, #=, #., #< are a few examples.
16:13:35
moldybits
trafaret1: (loop :repeat 5 :collect (random 10)) => (7 9 8 0 5) (loop :repeat 5 :collect #.(random 10)) => (6 6 6 6 6)
16:15:32
trafaret1
If I get your right it's just like evaluate the expression and that results send into another expression to evaluate
16:18:14
trafaret1
(loop :repeat 5 :collect #.(random 10)) => (6 6 6 6 6) for me it's strange behaviour
16:19:15
fivo
I am using slime with company. I installed the following plugin https://github.com/anwyn/slime-company
16:19:33
moldybits
trafaret1: (loop :repeat 5 :collect #.(random 10)) becomes (loop :repeat 5 :collect 6) after it's been read.
16:19:38
fivo
Before I used the plugin company also completed local varaibles which it doesn't anymore.
16:21:38
moldybits
most things are evaluated only once, but this exampled used a loop so it is more pronounced
16:22:47
_death
the first thing that happens when you load a file or enter text at the repl is that the reader gets called with the stream of characters.. the reader operates according to a readtable.. by default, this readtable contains an entry for the '#' character that dispatches further according to the following character(s).. if the character '.' is encountered, the reader gets called recursively to read the next object.. after the object is
16:22:48
_death
read, the reader will evaluate it, and return with the value, and the next step will commence
16:24:48
moldybits
(let ((x 42)) (+ 1 x)) => 43 (let ((x 42)) #.(+ 1 x)) => error: variable X unbound
16:29:56
_death
for example entering #.#.(list 'list ''list '''list) will have the reader call itself twice, the final result being (list 'list), which in turn will be passed to the evaluator, resulting in (list)
16:32:28
moldybits
(lol ((x 42)) (+ 1 x)) => Compile-time error: illegal function call ((x 42)) (lol ((x 42)) #.(+ 1 x)) error: variable X unbound
16:33:24
moldybits
the problem is not with the let, but that #.(+ 1 x) is evaluated before the let (or nonexistant lol) is evaluated
16:37:11
moldybits
(defparameter x 42) (let ((x 5)) (print #.x)) <- this prints 42 even when `sbcl --load file.lisp'. that surprises me.
16:38:57
_death
the defparameter form gets read and evaluated, then the let form gets read and evaluated