Search
Thursday, 13th of July 2017, 6:18:21 UTC
6:22:26
shka
reinuseslisp: system threads\
6:22:45
shka
reinuseslisp: https://common-lisp.net/project/bordeaux-threads/
6:26:10
reinuseslisp
shka: bt is for (logical?) threads, I mean something like unix's sysconf(_SC_NPROCESSORS_ONLN)
6:26:38
reinuseslisp
or C++'s std::thread::hardware_concurrency()
6:40:32
jackdaniel
reinuseslisp: bordeaux threads is just a portability layer which maps into threads in common lisp implementation
6:40:40
jackdaniel
most implementations use native threads
6:41:00
reinuseslisp
yes, I know that
6:42:27
reinuseslisp
I just didn't find a word to differentiate CPU cores/threads and application (bordeaux-) threads
6:51:21
jackdaniel
one way to do that with cffi is
6:51:27
jackdaniel
(cffi:defcfun "sysconf" :long (name :int))
6:52:16
jackdaniel
you can define 84 as constant to give it a meaningful name
6:56:44
reinuseslisp
jackdaniel: yes, but win32 seems not to offer that API
6:56:51
reinuseslisp
https://stackoverflow.com/questions/150355/programmatically-find-the-number-of-cores-on-a-machine
6:57:16
reinuseslisp
#+windows may work
7:11:46
jackdaniel
there are bindings to openmp for CL, if that's not an overkill, you could use that
7:12:48
jackdaniel
but I can't find the link, so maybe I'm wrong
7:50:03
schweers
does anyone have an idea why `prin1' or `format' with "~S" would emit a linefeed after printing a symbol? It seems to me that this only happens when printing on a socket stream.
7:53:21
jackdaniel
they don't: (with-output-to-string (s) (prin1 'a s)) ;-> "A"
7:53:32
jackdaniel
it might be return value in REPL what calls terpri
7:54:16
schweers
that’s the weird thing: when I output to a string all is well
7:54:34
schweers
I could swear that the code in question worked before, I’m really stumped why this happens now
7:55:22
schweers
also I’m not doing anything weird with the readtable, at least for this test
7:56:12
jackdaniel
some minimal test case to reproduce?
7:59:26
jdz
Printing has nothing to do with readtables.
8:00:11
schweers
damn, on the minimal test all is well
8:00:26
schweers
jdz: readtable-case has influence on how symbols are printed
8:01:12
jdz
True that. But in this case I suspect the problem is in pretty-printing.
8:01:49
schweers
well, I have to change the readtable-case as I’m interacting with a scheme, but that’s disabled for now
8:03:59
schweers
wait, pp should not be turned on, that’s why I’m using prin1 and/or format with "~S"
8:05:24
schweers
well, I can’t reproduce it outside of my program, which I find quite disconcerting. Oh well, more debugging it is.
8:05:28
jdz
PRIN1 only binds *PRINT-ESCAPE* to true, nothing about layout control.
8:05:48
schweers
that’s exactly what I too thought.
8:06:26
schweers
Well, if no one else has an idea, I suspect it really is a problem with some other code I’ve written, i.e. the problem is not me misunderstanding `prin1'
8:07:15
jdz
Have you tried binding *PRINT-PRETTY* to NIL?
8:08:29
schweers
ahhh, thank you so much, that did it!
8:08:55
schweers
somehow that possibility completely escaped me
8:10:05
jackdaniel
(setf *print-ugly* t) ;)
8:10:40
schweers
pff, my expressions should be pretty enough ;)
11:04:34
phoe
Is there any function that, given a cons and a value, destructively updates that cons in a way similar to PUSH?
11:05:05
phoe
Like - I can write it myself, it's simple, but is there anything like that out in the wild already?
11:07:08
_death
it depends on the place you give to push
11:29:06
phoe
Is (defgeneric foo (bar bar bar)) valid?
11:30:36
TMA
phoe: you mean something like (lambda (cons value) (push (cdr cons) (car cons)) (setf (car cons) value)) ?
11:30:47
phoe
Bike: neither SBCL nor CCL complain about it.
11:31:12
specbot
http://www.lispworks.com/reference/HyperSpec/Body/m_defgen.htm
11:31:41
Bike
the parameter names in the defgeneric are irrelevant except for debugging, so i can imagine it working and an implementation not bothering ot check
11:32:08
phoe
ECL chokes when I try to DEFMETHOD on that generic function
11:35:11
TMA
it looks like it might be a problem -- it shall be an generic-function-lambda-list -- which is a lambda-list -- which does not allow for repeated var names
11:35:33
phoe
sounds like it's time to file some bugs
11:38:41
phoe
jackdaniel: ECL does not complain about such a defgeneric either, ^
11:39:18
Bike
why would you want to do this. don't
11:40:11
phoe
I just found a bug in my few months' old code - it produced code like (defgeneric foo (t t t)) by mistake where it should have produced (defgeneric foo (bar baz quux)).
11:40:16
phoe
and SBCL did not choke on this.
11:41:44
phoe
so the moment someone ran this code on CCL for example, it would blow up.
11:48:02
Bike
well, t is additionally a constant
12:05:31
jackdaniel
generic? which generic
12:06:11
phoe
jackdaniel: (defgeneric foo (bar bar bar))
12:07:52
jackdaniel
please file a bug, though I don't think it's a high-priority issue (if you put t as parameter name you ask for a fail anyway)
12:17:11
schweers
jackdaniel: just out of curiosity: what exactly is the bug here? that such a defgeneric does not signal an error?
12:18:10
phoe
schweers: yes, it should signal an error.
12:18:25
phoe
a) because T is not a valid variable name as it's a constant, b) because there are duplicate parameter names
12:18:55
schweers
k, that’s what I thought, just wanted to be sure :)
12:19:20
phoe
jackdaniel: it's a petty issue, but as I said, it's possible to turn these into real-life compilation bugs
12:19:57
schweers
understandable, I’d like to know too if I ever made such a mistake
12:20:31
schweers
and not like the implementation to silently do the thing I probably meant. Although I think I’d prefer a warning over an error.
12:20:42
schweers
but hey, I don’t want to be nit-picking
12:21:01
phoe
the specification says this is an error though.
13:40:08
|3b|
is it actually forbidden to define a function with T as a parameter? T is a valid variable name (it has to be since it names a constant variable), you just aren't allowed to bind it (since it is a constant and in CL package), but binding doesn't happen until you call the function
13:40:41
|3b|
ACTION isn't arguing that anything that complains should stop complaining (even at full warning level), just curious if i missed something in the spec
13:40:44
schweers
I guess the reason it is illegal is that it is forbidden to redefine names defined in the standard
13:41:06
|3b|
it is forbidden to /bind/ them (and a bunch of other things unrelated to function parameters)
13:41:19
|3b|
but defining a function doesn't bind it
13:41:21
beach
schweers: That's not quite true.
13:41:35
beach
schweers: standard names can be used as lexical variables.
13:41:45
beach
... including function parameters.
13:41:46
specbot
The COMMON-LISP Package: http://www.lispworks.com/reference/HyperSpec/Body/11_aba.htm
13:41:53
schweers
beach: ah, so one is only forbidden from /globally/ defining them?
13:42:13
|3b|
ACTION reads it as no local bindings either
13:42:25
specbot
Constraints on the COMMON-LISP Package for Conforming Programs: http://www.lispworks.com/reference/HyperSpec/Body/11_abab.htm
13:42:26
Bike
"binding it as a function", etc
13:42:31
beach
schweers: The rules are a bit complicated. You need to look at the page.
13:43:18
Bike
defgeneric doesn't actually establish bindings, and i think it would be reasonable, if very slightly inconvenient, for an implementation to accept (t t t) as a gf lambda list
13:43:20
|3b|
ah, you can locally bind the ones that aren't variables
13:43:52
|3b|
ACTION forgot the 'exceptions' page, that exception doesn't apply to T though
15:10:03
raynold
ahh it's a wonderful day
15:29:09
diegs_
** NICK testingaverylong
15:29:20
testingaverylong
** NICK diegs_
15:41:36
kang0
Flipkart is open source fully?
15:44:29
beach
Do you have reasons to believe it is written in Common Lisp?
15:46:03
kang0
beach can you explain me about org mode
15:46:21
Bike
well, flipkart has a github
15:46:35
beach
kang0: No, I can't. And even if could, it would be off topic.
15:46:37
kang0
Does it mean it's open source? Bike
15:46:52
Bike
at least a dozen languages used, none of which seem to be lisp
15:47:34
Bike
https://github.com/Flipkart/null definitely some oddities
15:47:51
kang0
I wish I can replace my excel
15:47:55
Bike
why would it be more on topic if i explained it?
15:48:03
Bike
there's an #emacs i think, ask them
15:48:37
kang0
Which on topic stuffs you can explain me
15:48:56
kang0
What's some oddoties means?
15:49:19
Bike
"some oddities" as in "i think this is weird"
15:49:39
Bike
because it's nearly empty?
15:49:51
Bike
anyway, it looks like flipkart has dozens and dozens of forks of things which are mostly open source
15:50:22
kang0
https://github.com/Flipkart
17:11:59
nosefouratyou_
does anyone know of a small project I could write tests for? I want to practice using testing in cl.
17:12:48
malice
nosefouratyou_: any tests framework?
17:13:12
nosefouratyou_
I'd be happy to use whichever one someone else prefers
17:13:24
nosefouratyou_
I just want to learn about testing in cl
17:15:56
oleo
http://www.cliki.net/test%20framework
17:16:32
shka
nosefouratyou_: https://github.com/sirherrbatka/cl-data-structures
17:16:50
shka
there are tests, but not really unit tests
17:16:55
malice
Yes, cl-data-structures is one thing that you could test
17:16:59
malice
shka: how about cl-lore?
17:17:24
shka
it needs tests, but right now i'm refactoring it
17:17:26
malice
nosefouratyou_: and if you want to start *really* small, you can add tests to cl-sandbox: https://github.com/MatthewRock/cl-sandbox/
17:17:35
malice
at the end of the test file there's a todo note
17:17:40
oleo
stefil, rt and lisp-unit are the known ones to me actually (i mean not in depth)
17:17:44
shka
besides, there are no docstrings
17:17:53
nosefouratyou_
malice: I am definitely looking for something small to start with, thank you for that suggestion
17:18:11
shka
in cl-data-structure expected behavior is documented
17:23:30
nosefouratyou_
prove looks awesome! I really like the fact that it has colorized output, sort of like npm stuff
17:26:30
nosefouratyou_
is there a way in helm to make backspace delete the word instead of individual characters?
17:26:38
nosefouratyou_
sorry, wrong channel
18:08:52
shka
kang0: programmable gate array
18:08:59
shka
you can put soft chip on it
18:09:15
shka
electronic hardware to be exact
18:09:23
kang0
https://www.gnu.org/philosophy/free-hardware-designs.en.html
18:09:54
shka
well, i can explain their logic
18:10:10
shka
so, as i said FPGA is programmable gate array
18:11:39
edgar-rft
...like this: <https://en.wikipedia.org/wiki/Field-programmable_gate_array>
18:14:36
Bike
kang0: this isn't a general channel. you can get better help for a lot of questions elsewhere.
18:15:00
malice
kang0: is this related to Lisp?
18:15:52
edgar-rft
AFAIK there had been several attempts to implement Lisp Machines in FPGAs
18:16:43
kang0
Where's your memory?and promises? malice
18:16:55
malice
yeah, I could use more RAM
Thursday, 13th of July 2017, 18:18:21 UTC