Search
Monday, 17th of July 2017, 21:44:42 UTC
21:45:38
pjb
It calls (ql:register-local-projects)
2:14:16
adulteratedjedi_
** NICK adulteratedjedi
2:14:31
LyndsySimon_
** NICK LyndsySimon
5:26:49
beach
Good morning everyone!
6:10:25
axion
Does anyone happen to use company-mode in common lisp code buffers? I am trying to switch from auto-complete, but it seems to only be working in the repl mode. I would be interested in checking out someone's emacs config if it's no trouble.
7:31:57
phoe
axion: it works for me, but I use spacemacs - it's bundled in.
8:08:01
anticrisis
** NICK anticrisis_
8:20:35
phoe
What is the Lisp idiomatic way of counting digits of an integer?
8:21:01
phoe
I'd use a truncated decimal logarithm for that.
8:21:16
beach
I suppose you don't count initial zeros?
8:21:37
phoe
I'd always have infinite digits if I counted them. :)
8:21:50
phoe
I want (digits 1234567890) ;=> 10 in this case.
8:22:22
phoe
Also (digits -12345) ;=> 5 and (digits 0) ;=> 1, but these are easy once I have the tool for positive integers.
8:22:30
beach
Yes, the logarithm base 10 will probably. You might run into problems with precision if the numbers are large.
8:23:00
phoe
Either this, or I print an integer to string and use LENGTH.
8:23:32
beach
Does it have to be fast?
8:24:00
phoe
But then, my numbers won't have more than 100 digits I think, soo.
8:24:18
beach
Sure, then the length of the printed representation is probably best.
8:24:28
phoe
loke: yes, that's what I was thinking.
8:24:38
phoe
beach: with so little digits, LOG won't lose precision either.
8:30:52
otwieracz
Is this possible to match UNIX thread PID with SBCL thread?
8:31:04
anticrisis_
** NICK anticrisis
8:43:52
loke
The native function create_thread returns the thread id, but that return value is thrown away.
8:44:35
phoe
sounds like an improvement to SBCL
8:45:01
loke
I think it would make sense to save that value in the thread structure.
8:45:12
loke
You should psot it to the developer mailing list (or better, submit a patch)
8:45:28
phoe
just exactly my thoughts about saving it in the thread structure
8:45:31
loke
Check the function make-thread in target-thread.lisp
8:45:42
phoe
so later it can be retrieved
8:45:55
loke
You can see a call to %create-thread there. It checks whether the retyurn value is zero, bu8t if not, it should save it in the thread structure.
8:46:02
loke
Should be a small change to that function.
9:21:21
phoe
Is there any MOP way to prevent defining any writer or accessor functions for a class? I want to create a class that is immutable, as in, its slots are only set during creation.
9:21:41
phoe
Would this be achievable through a metaclass?
9:25:12
beach
http://metamodular.com/CLOS-MOP/setf-slot-value-using-class.html
9:26:14
phoe
That results in an error whenever SETF FOO is called.
9:26:52
beach
You define a subclass of STANDARD-CLASS, and then you define a method on (SETF SLOT-VALUE-USING-CLASS) that specializes to the new metaclass.
9:27:03
beach
The new method calls error.
9:27:37
phoe
Will this error be called during the compilation of a SETF method, or when such a method is used?
9:28:15
phoe
Good enough for my use.
9:28:54
phoe
And later I go (:metaclass 'immutable-class) inside DEFCLASS, correct?
9:29:19
beach
Not sure about the quote.
9:30:35
phoe
ACTION just thought of a very bad pun.
9:31:03
phoe
'not <- this expression is not quoted.
9:37:59
phoe
Can metaclasses be introduced by a protocol, since they are just classes after all?
9:38:36
phoe
Because it sounds pretty logical for it to work this way.
Tuesday, 18th of July 2017, 9:44:42 UTC