freenode/#lisp - IRC Chatlog
Search
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
17:10:41
flip768
I know that I can have (AND whitespace ... whitespace) in the rule, but then I need to explicitly do something to not return them
17:41:53
pfdietz
The top level forms are processed before the following forms are read. Things like (in-package ...) would not work if that weren't the case.
17:43:12
specbot
Processing of Top Level Forms: http://www.lispworks.com/reference/HyperSpec/Body/03_bca.htm
17:46:51
pfdietz
trafaret1: a common idiom for sharp-dot is putting constant variable values into CASE forms.
17:48:20
_death
pfdietz: I wrote about it a long time ago.. "One minor thing" paragraph @ https://github.com/death/consix/wiki/Postmortem---a-bit-of-postmortem-never-hurt-anyone!
17:50:56
pfdietz
I think that would be fine, as long as the defconstant appears in another file. That way, the form will have been evaluated by the time its value is needed.
17:54:28
pfdietz
Macro definition is fine. "If a defmacro form appears as a top level form, the compiler must store the macro definition at compile time, so that occurrences of the macro later on in the file can be expanded correctly. "
18:58:43
ark
fivo: I have slime-company working with completion in the repl lisp files. Here's my config: https://gitlab.com/_ark_/dotfiles/blob/5967f8c68ea7fbe4b5c852b134fb14404b4564ff/emacs.d/init.el#L997-1002
19:20:50
fiddlerwoaroof
fivo, ark: I use slime-company too, but in my experience, it can be a pain getting it to work
19:47:06
scymtym
i guess a feature request here https://github.com/wallyqs/org-ruby would be appropriate, but getting off topic