<beach>
It looks to me like you need to make your output go to the input stream of the echo stream.
<pillton>
char: When you write to S in your example it sends the data to the output stream.
<pillton>
char: I think you need another library to create a pipe.
<char>
I see now. pillton: which library would that be?
<pillton>
I am trying to think. I have seen someone do it but I can't remember where.
<pillton>
cl-plumbing I think.
<pillton>
I imagine there would be a few implementations.
<pillton>
I'd look for systems/libraries which depend on trivial-gray-streams.
Bike has quit [Quit: Connection closed]
<kakuhen>
iirc osicast-posix has a wrapper for pipes
<kakuhen>
yup it exists, i just checked
<kakuhen>
and iirc this same library also offers a relatively portable way to make "fd-streams"
silasfox_ has quit [Ping timeout: 250 seconds]
<beach>
jcowan: We can't know that all those function should be changed. The reason I am making individual issues is so that each one can be discussed and voted upon separately.
<beach>
jcowan: But thanks for the list of candidates. It saves me a lot of work going through each Common Lisp HyperSpec page.
mrcom has joined #commonlisp
taiju has quit [Ping timeout: 265 seconds]
green__ has quit [Ping timeout: 272 seconds]
maddog has joined #commonlisp
Qwnavery has joined #commonlisp
taiju has joined #commonlisp
Inline has quit [Quit: Leaving]
silasfox_ has joined #commonlisp
shka has joined #commonlisp
CrashTestDummy2 has joined #commonlisp
CrashTestDummy has quit [Ping timeout: 272 seconds]
spiaggia has joined #commonlisp
nirnam has joined #commonlisp
wilfred has joined #commonlisp
<moon-child>
'Prima facie these are all candidates for adding type-error for each wrongly typed argument' barring constructors and predicates, and a couple of other fun ones like constantly
<spiaggia>
Yes, it's a good list.
CrashTestDummy3 has joined #commonlisp
gaqwas has joined #commonlisp
<moon-child>
(actually, I guess constantly is a function constructor :P)
<spiaggia>
By "barring", do you mean that they are not (yet) on the list, or that they are and they shouldn't be?
<moon-child>
the latter
CrashTestDummy2 has quit [Ping timeout: 250 seconds]
<spiaggia>
Why would you exclude constructors?
<moon-child>
when would, say, CONS signal a type error?
<spiaggia>
Sure, CONS should not. But other constructors might, like MAKE-ECHO-STREAM.
<moon-child>
you are right. I should have said 'certain constructors'
<spiaggia>
Ah, OK. I understand.
<phantomics>
Hi, a question. I can't create subclasses of built-in CL classes like simple-array, so is there any other way of creating an array that has some specialized metadata that it carries with it but which functions as a standard array in all other respects and can be arefed and measured without the code doing so needing to be aware of its special type?
Lord_of_Life_ has joined #commonlisp
Lord_of_Life has quit [Ping timeout: 256 seconds]
Lord_of_Life_ is now known as Lord_of_Life
<hayley>
You could put the metadata in a weak hash table, but of course that is not in the array, and it is not reflected in the type system.
<phantomics>
That's what I've been doing, created a big hash table whose keys are the actual arrays I'm keeping track of
<phantomics>
There are various annoyances with this approach
amb007 has quit [Ping timeout: 265 seconds]
<spiaggia>
You need to wait for SICL in which arrays are instances of standard classes. :)
<flip214>
phantomics: you could have a few reserved elements in your array - eg. at the beginning. (Perl would allow to specify a negative start point for the indizes; CL doesn't, sadly.)
<spiaggia>
And no, you can't create subclasses of built-in classes.
<moon-child>
I thought you were still not going to allow user code to subclass them, for portability reasons?
<phantomics>
Sounds great, but will only work with SICL
<spiaggia>
moon-child: Me? It will be hard to stop them.
<phantomics>
flip214: the problem with that approach is that I want these arrays to be usable with any old CL code outside the system without someone having to make special allowances
<moon-child>
Hm. I thought you had said you were going to add a special-case to prevent that. I must be misremembering
<spiaggia>
I may have said that. And I may have changed my mind. :)
<phantomics>
Currently, the arrays April generates are completely standard Lisp arrays, you can aref them, take their size and dims like any other array. If I wrap the contents in another array structure containing metadata it'll defeat that purpose, I might as well create a special class containing the array and its metadata at that rate
<moon-child>
phantomics: what metadata do you want to store?
<spiaggia>
moon-child: In fact, I think it would be a good idea to expose the mechanism by which I create specialized arrays, so that someone who wants an array of (say) 24-bit integers can do that. It is basically a matter of defining the transformations CST-AST-HIR-MIR and associated classes.
<flip214>
phantomics: you could make the visible array displaced, and keep the metadata in the array the visible one is displaced to
<phantomics>
moon-child: I want to store something called the "array prototype." This sounds very strange, but an APL array will "remember" what its first element was if you shrink it to size zero, and if you then take that 0-size array and do a larger take of it, it'll reproduce its first element
<spiaggia>
moon-child: And, the SICL code should also be structured this way in fact. Currently, that's not the case.
<flip214>
but that makes a bit of difference - performancewise, and what you can do with that (displaced) array
<phantomics>
moon-child: if an array's first element is an array itself, the prototype will be an array of the same composition but with all its values set to the default for its type, like blanks for characters and zeroes for any other type. Hopefully that makes some sense
<moon-child>
phantomics: what is wrong with using a fill pointer?
<phantomics>
moon-child: so for a 20x10 array with metadata, I could have the base array be a 201-element vector with the first element containing metadata, and then there would be a 20x10 array displaced to it with an offset of 1?
<moon-child>
that could work
<phantomics>
If I have a fill pointer my understanding is that the (array-size), (aref) and other functions will still be aware of the array's full size, my goal is to have something that behaves just like an array for an external system that receives these arrays but has some special metadata
<phantomics>
Is there a way to find out the array that a given displaced array references?
<moon-child>
though note for certain higher-rank array operations it is useful to pad the shape to have some alignment
<phantomics>
Ok, that could work, so you're suggesting create an extra row for the "parent" array, the first element would be the metadata and the rest of the element would be blank
<phantomics>
Although the thing is, all arrays that need this metadata are necessarily empty, like (SIMPLE-ARRAY (UNSIGNED-BYTE 8) (0 0 0))
<phantomics>
If an array is populated I don't need to store this data for it
Qwnavery has quit [Quit: WeeChat 3.2]
<flip214>
phantomics: well, then declare (deftype my-array-prototype () T), and when an array should be empty it actually contains 1 element, with that type.
<flip214>
so, by checking the :element-type, you can see that an incoming array should be treated as empty.
<flip214>
another idea: only when empty, the array is displaced - to another array, whose elements contain the dimensions and/or type
<flip214>
so array-displacement is the boolean check for emptiness
CrashTestDummy2 has joined #commonlisp
<phantomics>
That sounds like the best approach
<phantomics>
I only need to collect this data for empty arrays that were reduced from an array with an array as its first element
<phantomics>
So when that is done, I'll create a 0-size array that's displaced to a 1-size vector whose element contains the list of metadata
CrashTestDummy3 has quit [Ping timeout: 258 seconds]
<flip214>
it might be more convenient to have a non-displaced array with a :fill-pointer 0 and size 1, with the prototype in index 0. perhaps there's a performance difference for array-has-fill-pointer-p vs array-displacement.
<moon-child>
empty arrays are likely to be the exception rather than the rule. And fetching the prototype is a constant overhead in any case. I don't think optimizing heavily for that case is worthwhile
<phantomics>
Yeah, the logic will be 1) is the array empty? 2) is it displaced? 3) get the displaced-to array and check for valid metadata
<phantomics>
This is a corner case and one of the stranger things about APL's array model, the only aspect that can't be neatly reproduced in CL
<moon-child>
prototypes are convenient at times, but ... I don't like them
<moon-child>
you're making your own implementation! Break from convention!
spiaggia has left #commonlisp [ERC Version 5.3 (IRC client for Emacs)]
amb007 has joined #commonlisp
<phantomics>
That's the trouble with CL... if you want to break from convention you open the door to a host of compatability problems
<beach>
And that's a problem with Common Lisp?
rain3 has joined #commonlisp
amb007 has quit [Read error: Connection reset by peer]
<phantomics>
If you want to add new features to the language, yes, that's what drove fare to Gerbil Scheme
<moon-child>
you're using cl to make an apl implementation. No apl implementation is compatible with any other anyway, so I don't see the problem?
<moon-child>
nothing to do with cl
amb007 has joined #commonlisp
<beach>
Unbelievable!
<phantomics>
Ok, if you're talking about APL that's a different thing
<rain3>
what's wrong with the current apl implementations in CL ?
<phantomics>
I could just leave array prototypes out but it's an accepted feature of the language, there's some interesting code out there that uses them
<phantomics>
rain3: the current APL implementations in CL? As in multiple? haha
<rain3>
at least one
<beach>
Yesterday, we heard that Common Lisp is bad because it has a standard, and today we hear that Common Lisp is bad because it is strict about conventions.
<beach>
Truly unbelievable.
<phantomics>
April is -the- one
<phantomics>
CL is still the best of all options I know of
<flip214>
beach: like with parents... either too strict or not opinionated enough
<moon-child>
can't you just make everything use prototype 0? I can't imagine there's _very_ much interesting code using characters or nested arrays in a way that that would matter for
<pl>
beach: what, what was that about standard being bad?
<pl>
was it a pythonista claiming it?
<beach>
pl: Check the logs. It makes me upset just to think about it.
<phantomics>
The Schemes all have discordant features, choosing one is taking a major gamble that it won't fall out of favor. The Racket devs seem to want to move it away from being a Lisp entirely
<pl>
jeez. Sorry for bringing up bad memories, I'm just too WTF at it
<shka>
pl: pythonists seem to have a slavish mentality so i my bet is that it is not one of those :P
<beach>
pl: Yes, me too (when it happened).
<shka>
slaveish?
gaqwas has quit [Ping timeout: 258 seconds]
dsk has quit [Ping timeout: 272 seconds]
CrashTestDummy has joined #commonlisp
<pl>
shka: Python is also one of the few languages that /explicitly/ go out of their way against standardisation. Maybe Rust too, but most other stuff has some level of standardisation even if it's not fully formal static one
<phantomics>
moon-child: I can easily have the array default element be either " " for character arrays or 0 for all other array types, I can deduce that from an array's type
<shka>
pl: sure, but the typical python programmer is just all over the every little detail of python guideline
<phantomics>
The array-as-prototype is useful in a few cases, I've ported some functions from Dyalog that use the feature to do interesting things
<shka>
regardless if it makes sense or not
<pl>
phantomics: CL being mostly compatible between implementations (and nearly to the point of irrelevance when you add portability libs) is what finally got me good on Lisps :)
<moon-child>
phantomics: interesting, have a link?
CrashTestDummy2 has quit [Ping timeout: 265 seconds]
<phantomics>
click "test script" to see tests using it
<phantomics>
The (0⍴⊂_)from 99 is a particular case of using a displaced array, the 0⍴ creates an empty array whose prototype is the "_" variable defined earlier
<phantomics>
The idea of being to create arbitrary-shape nested arrays from with a prototype array element is useful for a few things
ad-absurdum has joined #commonlisp
lad has quit [Ping timeout: 240 seconds]
<susam>
Good morning, #commonlisp!
<phantomics>
morning, susam
<susam>
Hello, phantomics.
pve has joined #commonlisp
selwyn has joined #commonlisp
scymtym has quit [Ping timeout: 258 seconds]
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
j-sh has joined #commonlisp
j-sh has quit [Client Quit]
azimut_ has joined #commonlisp
hendursa1 has joined #commonlisp
azimut has quit [Ping timeout: 244 seconds]
hendursaga has quit [Ping timeout: 244 seconds]
kakuhen has quit [Quit: Leaving...]
scymtym has joined #commonlisp
heisig has joined #commonlisp
<pve>
phoe: Hey, you mentioned yesterday that "the reader macro for #\( cannot call READ-DELIMITED-LIST directly". Can I read more about this somewhere?
<beach>
pve: I think phoe is just making the observation that READ-DELIMITED-LIST has no provisions for handling the consing dot.
<beach>
pve: The reader macro for #\( must be able to handle things like (A B . C).
<pve>
beach: hmm, I see
<pve>
on CCL I get: (with-input-from-string (s "a b . c)") (read-delimited-list #\) s)) ==> (A B . C)
<pve>
I might be misunderstanding
wilfred has quit [Quit: Connection closed for inactivity]
<beach>
I don't think so. It seems CCL READ-DELIMITED-LIST can handle the consing dot.
<pjb>
Indeed, the lisp reader algorithm and specifications of the reader macros imply that the reader macro for #\( cannot use the standard read-delimited-list.
<pjb>
pve: note: #(a b c) could use read-delimited-list. But ccl uses a ccl::read-list in that case :-P
<phoe>
pve: exactly what beach said
<phoe>
and what pjb clarified
<pjb>
The algorithm of read-delimited-list is specified: read-delimited-list looks ahead at each step for the next non-whitespace[2] character and peeks at it as if with peek-char. If it is char, then the character is consumed and the list of objects is returned. If it is a constituent or escape character, then read is used to read an object, which is added to the end of the list. If it is a macro character, its reader macro function is
<pjb>
called; if the function returns a value, that value is added to the list. The peek-ahead process is then repeated.
<pve>
pjb: ok good to know, thanks
<phoe>
in that case, SBCL is conforming, CCL is convenient
<phoe>
pjb: now I am longing for a publicly exported and available CCL::READ-LIST, why did you mention it out loud
* phoe
adds it to the idea box for the Hypothetical Future Revision
retropikzel has joined #commonlisp
<pjb>
phoe: well, the point is that ccl inverts ccl::read-list and cl:read-delimited-list !
<pve>
although, I should admit, I don't quite see *why* the specification implies that read-delimited-list can't be used
<pve>
is it hidden in the paragraph pjb quoted?
<phoe>
pve: yes
<phoe>
there is no mention of a consing dot in the algorithm
* pve
is still having morning coffee
<beach>
The consing dot is a constituent, but if it is read by itself, it signals an error.
<pjb>
beach: Well, non-conforming is perhaps too strong a word. The problem is that (typecase foo (single-float 1) (double-float 2)) may list two identical types. It will make compilers generate code about unreachable code (eg. 2).
<beach>
OK, that I agree with.
<pjb>
The docstring of distinct-float-types quotes the small constraints on how to split the floats when fewer than 4 types are provided.
<pjb>
But not the url. :-(
retropikzel has left #commonlisp [Leaving]
d4ryus has quit [Ping timeout: 240 seconds]
pillton has quit [Ping timeout: 256 seconds]
d4ryus has joined #commonlisp
<mrcom>
pjb: Weird crashes I was getting in CCL on OSX have stopped. Which is even weirder. Didn't update anything.
pjb has quit [Ping timeout: 256 seconds]
igemnace has quit [Remote host closed the connection]
hendursa1 has quit [Remote host closed the connection]
hendursa1 has joined #commonlisp
amb007 has quit [Ping timeout: 252 seconds]
amb007 has joined #commonlisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
frgo has quit [Remote host closed the connection]
frgo has joined #commonlisp
silasfox has quit [Ping timeout: 265 seconds]
silasfox has joined #commonlisp
nij- has joined #commonlisp
<nij->
Swank.lisp has ~4000 lines of code, much for a newbie like me. Could someone confirm that it implements socket/connection by itself, making no use of any networking library like usocket or trivial-socket? https://github.com/slime/slime/blob/master/swank.lisp
tyson2 has joined #commonlisp
<lotuseater>
what is good to notice, swank only accepts connections from localhost
<lotuseater>
look in the file swank.asd
<nij->
Yeah.. I'm thinking if it's possible to factor the socket part out, making it easier to support other protocols.
<Xach>
nij-: it is essentially implementing its own version of usocket or similar.
<Xach>
you can save time by using usocket or similar directly.
<nij->
Xach: Thanks for your confirmation. And yes, if they switch to usocket, the amount of codes could be largely decrease.
<Xach>
"they"?
<Xach>
Ah, I misunderstood your goal. I don't think swank will ever change like that.
<nij->
Why not?
<Xach>
Because I don't think the people involved will see it as a net benefit
<nij->
Oh I see. I remember seeing one closed issue that addresses this too.. :(
<pl>
nij-: the issue is that you want swank to run self-contained so that you can just start it on any supported implementation without external dependencies
yitzi has joined #commonlisp
<nij->
That makes sense. I feel that being orthogonal and being self-contained are two good attributes that contradict to each other.
<nij->
Wonder how people strike the balance between them.
<shka>
swank does not support encryption or logging so it's only natural that localhost is only allowed
<nij->
shka: My apologies if the following is too simple: Does that mean all instances in the same LAN can get access to my swank server?
<shka>
nij-: no, just machine where the swank is running
<shka>
otherwise, you typically tunnel via ssh
<nij->
I see.
<nij->
My main concern is that I want to let root to open a swank server, without letting the other users (on the same machine) to get access to it.
<nij->
Is it possible?
<akater[m]>
What should `(truename #P"")` return? I can't even infer it must share attributes with `*default-pathname-defaults*`.
<jmercouris>
there was a small typo in the old version
<lotuseater>
yeah now (push point cluster)
<jmercouris>
that is correct
<shka>
jmercouris: it would be easier if clusters would be vectors
<shka>
then use find
<jmercouris>
shka: ?
<shka>
and vector-push-extend result
<shka>
this is in relation to code that you pasted
<jmercouris>
right, but how would that be easieR?
<shka>
well, because then you would simply CL:FIND-IF the right cluster, and you could vector-push-extend to it if found
green__ has joined #commonlisp
<shka>
or make a new cluster if not
<shka>
you can still do that by playing with cdr of the first cons cell
<jmercouris>
I guess what tripped me up was why you thought vectors would be easier
<jmercouris>
because I was thinking it could be done exactly that way but with lists
<shka>
but this is not exactly nice either
<jmercouris>
also there is a mistake in my code, the finally breaks out of both loops
<shka>
well, vectors are "naturally" mutable if you know what i mean
<yitzi>
shka's solution would only have a single loop. That makes it better, IMHO.
<jmercouris>
OK
<jmercouris>
I'll try it
<shka>
if you really want to use lists
<jmercouris>
I just can't help but feel this is a solved problem
<jmercouris>
and there is some alexandria function
<shka>
you can use position-if
<jmercouris>
I have had to do to this kind of operation many times
<jmercouris>
grouping things based on some predicate
<shka>
i am not aware of anything like this in alexandria, sorry
green__ has quit [Read error: Connection reset by peer]
<yitzi>
If you need to do that kind of thing and position, find, member, etc don't work I would suggest writting a function to do it versus making an embedded loop. I personally find them to be confusing sometimes.
borodust is now known as boro
boro is now known as borodust
random-nick has quit [Ping timeout: 240 seconds]
<jmercouris>
never mutate a variable you are looping over...
<jmercouris>
ay yai yai, you would think I am a first year programmer
dickbar__ has joined #commonlisp
dickbar__ is now known as DBa_
DBa_ is now known as DBar
DBar is now known as DBa_
DBa_ is now known as DBa55
random-nick has joined #commonlisp
pjb has joined #commonlisp
DBa55 has quit []
dickbar__ has joined #commonlisp
<pjb>
mrcom: perhaps because of an upgrade of the system? Since Apple collects crash reports, it may correct its system before the application developper can get around them ;-)
dickbar__ is now known as DBa55
retropikzel has joined #commonlisp
PinealGlandOptic has quit [Quit: leaving]
Melantha has joined #commonlisp
Bike has joined #commonlisp
<Josh_2>
'ello
<rain3>
hey
Guest87 has joined #commonlisp
<phoe>
heyyyy
<Guest87>
Hi
<beach>
Hello Guest87.
<Guest87>
Would a spinneret question fit here?
<beach>
Go ahead and ask.
<Guest87>
I'm trying to generate a table from a list of lists representing the rows. The straightforward dolist works for text data. I need the first column to be buttons. I can't get a (:button) from a list to evaluate. I'm stumped.
<rain3>
show a working snippet with the straightforward dolist which works, maybe we can change it into something better
<Guest87>
That produces two rows of two cells. My intuition was to substitute something like (:button "Test1") and (:button "Test2") for "a" and "c", or something similar.
Guest87 is now known as eric
<rain3>
(spinneret::parse-html '(:button "test1") nil) ;;; just playing with it
silasfox has quit [Ping timeout: 276 seconds]
silasfox has joined #commonlisp
<rain3>
I remember that spinneret in public interface only has macros , that's the reason it is awkward when we need to pass data to it other than hardcoded sourcecode and we must use eval
<tfb>
dumb question: is there a version of quickload which loads only if not already loaded (like require ish)
<beach>
tfb: That should already be the case.
<tfb>
oh. Does that mean quickload tells you what it *would* do? So it's 'To load ...' message doesn't mean it is loading it?
lisp123__ has joined #commonlisp
<beach>
I don't know. I use ASDF directly most of the time.
<tfb>
answer is yes, it does and I'm an idiot: tracing load would have told me.
<eric>
Josh_2: close, and was another approach, but that hardcodes the column as a button. I was looking for a generic (make-table) that I could feed lists with tags in the list instead of the generator.
<Josh_2>
so you would have a button depending on a tag at the start of the list?
lisp123_ has quit [Ping timeout: 245 seconds]
<eric>
I'd have a button in a cell when the data list had a (:button) in it instead of a "plain text" element. So it could be '((:button "button1") "b") or '("b" (:button "button1:)), with the items switching places.
<eric>
Interesting approach. I thought about listp, but if I wanted to use an (:a "http://somewhere") or (:img "smile.png") I'd have to write more cases on (car a), (car b), for each tag type.
<Josh_2>
Nah
<Josh_2>
Oh yes sorry
<Josh_2>
I finally see what you mean
lisp123__ has quit [Remote host closed the connection]
lisp123_ has joined #commonlisp
<Josh_2>
eric: I believe this is what the tag :tag is for
<Josh_2>
you would do something like (if (listp <item>) (destructuring-bind (tag ele &rest args) <item> (:tag :name tag ele)) (:th ele))
<eric>
I wondered about that, but I didn't understand it.
<Josh_2>
:tag allows you to select arbitrary tags
<Josh_2>
When you were talking about this I was certain I had done this before
<eric>
Oh, right, but what tag do I use for plain text?
<Josh_2>
p or span
lisp123_ has quit [Ping timeout: 240 seconds]
<eric>
I guess I could listp and use :tag on lists.
<Josh_2>
Well :tag lets you select your tag at runtime, how you use it is up to you :P
Lycurgus has joined #commonlisp
Patternm1ster has quit [Quit: leaving]
Patternmaster has joined #commonlisp
selwyn has quit [Read error: Connection reset by peer]
<rain3>
Josh_2 cool
<Josh_2>
Front end webdev really sucks, even if you are using a great language like CL
psycomic has joined #commonlisp
<phoe>
Is it possible to get a symbol macro definition somehow?
<phoe>
Or is macroexpand-1 on a symbol the way to go?
lisp123_ has joined #commonlisp
Oladon has joined #commonlisp
waleee has joined #commonlisp
<Bike>
phoe: that is how you do it
<Bike>
is there something more than the expansion you want?
<phoe>
nope
lisp123__ has joined #commonlisp
<Bike>
technically it might be required that there's an expander so *macroexpand-hook* works, but there's no standard way to retrieve it
<phoe>
wait a second, BLOCK NIL is unnecessary there
silasfox has quit [Ping timeout: 272 seconds]
<Bike>
huh.
<phoe>
if the macroexpand hook has access to the expander function, then I have access to the expander function
<phoe>
so I can just RETURN-FROM it, or something
<phoe>
except above I forgot to RETURN-FROM it, and miraculously this code still worked despite not being correct
<Bike>
i hadn't thought of that.
silasfox has joined #commonlisp
lisp123_ has quit [Ping timeout: 272 seconds]
<phoe>
that was the first thing that I thought of, but I'm a control flow freak
<Bike>
i mean i hadn't thought of using macroexpand-hook like that at all
<jcowan>
One of those "I don't know how this *ever* worked" moments.
<phoe>
oh, I see
<phoe>
well usually you don't want to escape the macroexpand hook early
psycomic has quit [Remote host closed the connection]
psycomic has joined #commonlisp
fbiaaa has joined #commonlisp
ad-absurdum has quit [Quit: Leaving]
lisp123__ has quit [Remote host closed the connection]
lisp123_ has joined #commonlisp
lisp123_ has quit [Ping timeout: 272 seconds]
Lycurgus has quit [Quit: Exeunt]
cage has joined #commonlisp
<fbiaaa>
hi! I'm using company-mode in Emacs but get no completion suggestion while editing common lisp file. I'm using two company backends: company-files and company-capf. Should I add some other backend?
eric is now known as icer
icer is now known as rr
rr is now known as icer
lisp123_ has joined #commonlisp
selwyn has joined #commonlisp
silasfox has quit [Remote host closed the connection]
silasfox has joined #commonlisp
tfb has quit [Remote host closed the connection]
tfb has joined #commonlisp
tfb has quit [Remote host closed the connection]
tfb has joined #commonlisp
psycomic has quit [Remote host closed the connection]
psycomic has joined #commonlisp
tfb has quit [Remote host closed the connection]
tfb has joined #commonlisp
tfb has quit [Remote host closed the connection]
tfb has joined #commonlisp
tfb has quit [Remote host closed the connection]
<beach>
fbiaaa: Use SLIME and slime-company.
tfb has joined #commonlisp
<mfiano>
Or Sly with company support built-in
tfb has quit [Remote host closed the connection]
tfb has joined #commonlisp
<beach>
Having said that, I find slime-company more irritating than helpful most of the time.
<beach>
I can type the completion faster than I can select the right choice.
tfb has quit [Remote host closed the connection]
tfb has joined #commonlisp
<beach>
And often I get suggestions that are completely wrong for the context, and no suggestions that would be appropriate.
tfb has quit [Remote host closed the connection]
nij- has quit [Quit: Using Circe, the loveliest of all IRC clients]
tfb has joined #commonlisp
tfb has quit [Remote host closed the connection]
tfb has joined #commonlisp
tfb has quit [Remote host closed the connection]
tfb has joined #commonlisp
tfb has quit [Remote host closed the connection]
tfb has joined #commonlisp
<beach>
I guess it's a consequence of the fact that Emacs and SLIM have very limited "knowledge" about the meaning of the Common Lisp code.
<phoe>
the following line is cursed:
<akater[m]>
Asking again, just in case: what should `(truename #P"")` return according to spec? SBCL and ECL both seem to use `*default-pathname-defaults*` here but I don't see why it should be taken into account.
tfb has quit [Remote host closed the connection]
<phoe>
(import 'lambda-list-keywords "KEYWORD")
<phoe>
akater[m]: woop, apologies
tfb has joined #commonlisp
tfb has quit [Remote host closed the connection]
tfb has joined #commonlisp
tfb has quit [Remote host closed the connection]
tfb has joined #commonlisp
tfb has quit [Remote host closed the connection]
tyson2 has quit [Ping timeout: 272 seconds]
tfb has joined #commonlisp
tfb has quit [Remote host closed the connection]
tfb has joined #commonlisp
<phoe>
akater[m]: I guess that the NIL pathname directory gets interpreted same as (:RELATIVE)
<phoe>
and getting the truename of a pathname that is relative to the current directory and has all other components empty is going to result in the current directory
tfb has quit [Remote host closed the connection]
tfb has joined #commonlisp
<phoe>
I mean, (merge-pathnames #p"") does that
<phoe>
can't see why TRUENAME would do it differently
<akater[m]>
phoe: Thank you. So, `(:relative)` directory component should always be converted to nil.
tfeb has joined #commonlisp
Oladon has quit [Quit: Leaving.]
tfb has quit [Ping timeout: 265 seconds]
<phoe>
yes, the two are equivalent
tfeb has quit [Remote host closed the connection]
tfb has joined #commonlisp
pjb has quit [Ping timeout: 272 seconds]
<akater[m]>
Well, it says “not used”. I read it as, `(:relative)` should not occur as the value.
amb007 has quit [Read error: Connection reset by peer]
<phoe>
"The list (:relative) has the same meaning as nil and hence is not used."
amb007 has joined #commonlisp
<phoe>
hm
<phoe>
if it has the same meaning that I assume that it's safe to use it there
<akater[m]>
I happen to be porting pathnames to elisp so gotta adhere.
aeth has quit [Ping timeout: 272 seconds]
amb007 has quit [Ping timeout: 272 seconds]
silasfox has quit [Ping timeout: 276 seconds]
amb007 has joined #commonlisp
aeth has joined #commonlisp
<phoe>
yep, I understand
attila_lendvai_ is now known as attila_lendvai
<phoe>
I read this as, "(:RELATIVE) is not going to occur in any pathnames returned by the Lisp implementation because it will use NIL instead, but if you use (:RELATIVE), then it's harmless, Lisp will treat it same as NIL"
pjb has joined #commonlisp
DBa55 has quit []
<lisp123_>
Can the condition system replicate continuations?
<phoe>
no
<phoe>
continuations require the ability to store away control stacks, whereas the condition system works on a single control stack.
<lisp123_>
Thanks - I was wondering if it was possible with some sort of nesting structure
<phoe>
when an unwind is performed, whether by the condition system or by some other means, the stack is destroyed
<phoe>
you can't work around that without support from the language runtime
<lisp123_>
Got it, thanks
kpoeck has joined #commonlisp
<phoe>
gotta go lower level than conditions if you want to get support for that
<lisp123_>
Yeah I was able to do it via PG's Continuation Macros (which I'm debugging now, not sure if I made a mistake somewhere), but was something that just popped in my mind because he was using the function RESTART, which means he did it before the condition system entered CL
<pjb>
akater[m]: that's because TRUENAME must do the same as OPEN, and OPEN must call MERGE-PATHNAMES on relative pathnames. "For information about opening relative pathnames, see Section 19.2.3 (Merging Pathnames)."
<lotuseater>
lisp123_: but the other way around could be possible ^^ Continuations, the mother of all monads :D
amb007 has quit [Ping timeout: 265 seconds]
<lisp123_>
lotuseater: And GOTO the mother of all expressions :D
tfb has quit [Quit: died]
<Bike>
restarts only have dynamic extent, so you couldn't use them for full call/cc
<lotuseater>
I thought it was: Lambda, The ultimate GOTO.
<lisp123_>
Good article for anyone interested
<lotuseater>
nice thx
<lisp123_>
lol I just linked the same article
<lotuseater>
wish me luck, later I have the first phone call with the customer for the new project
<lisp123_>
(append 'luck lotuseaster)
<lotuseater>
hah lisp123_ we had the same thought. there are also this paper with Imperative/Declarative
<lotuseater>
hm would that work?
<pjb>
(let ((lotuseaster '())) (append 'luck lotuseaster)) #| ERROR: The value luck is not of the expected type list. |# (let ((lotuseaster '())) (append lotuseaster 'luck)) #| --> luck |#
amb007 has joined #commonlisp
<lotuseater>
or (setf (person-lucky-p *lotuseater*) t) or an amount between 0 and 1 but bigger than 0
<lotuseater>
i should drink some water
<pjb>
lisp123_: we can implement delimited continuations in CL easily enough. But full contiuations need a lot of machinery (basically a re-compilation of the CL code).
<pjb>
So the processor doesn't have to jump back to unstacked stack frames.
<pjb>
Ie. we don't have to copy stack frames to the heap.
<lisp123_>
Thanks, that makes sense (and what was noted in On Lisp too)
<lotuseater>
when I told someone it's kind of runtime GOTO he just heard "GOTO" and said "no that shouldn't be used"
<beach>
That's what Turbo thought about Pascal, so they removed the only exception mechanism that Pascal had.
<Bike>
delimited continuations as used in other languages are orthogonal to lexical extent
<Bike>
you can see this in the wikipedia article in the definition of "yield" a ways down
<lisp123_>
Bike: that is a very nice and clear way to put it
* lotuseater
presses the "Turbo" button at his computer
<Bike>
you might also have to copy frames to the heap to implement them, since the delimited continuation still has indefinite extent, which you can see in "stream-yield" where the continuation is stored in a lazy list
<lisp123_>
Yes (i think, haven't look at "stream-yield" yet)
<Bike>
i don't remember how well CPS transform macros fit into this off the top of my head
<lisp123_>
They seem to work well for most cases
<Bike>
i just mean i don't remember whether they're theoretically equivalent to some kind of delimited continuation or what
kpoeck has quit [Quit: Client closed]
<lisp123_>
Based on what I saw, I say they are, but there might be some points I missed, I'm only looking at the two at a superficial level
<lisp123_>
"If an =bind, =values, =apply, or =funcall expression occurs in a seg- ment of code, it must be a tail call. Any code to be evaluated after an =bind should be put in its body."
<lisp123_>
vs. "So the processor doesn't have to jump back to unstacked stack frames."
<lisp123_>
Sounds about the same
<Bike>
okay, but as i mentioned, that's not actually an accurate description of delimited continuations
<Bike>
that's just a continuation with dynamic extent, which we already have with block/return-from
<White_Flame>
yeah, I've made the same linguistic mistake before
<Bike>
and i think CPS macros give you more than that
<lisp123_>
Nice, I will have to read into it more
amb007 has quit [Ping timeout: 250 seconds]
amb007 has joined #commonlisp
<Bike>
block/return-from are undelimited continuations, i guess, since they abort control, unlike a delimited continuation
<Bike>
some confusing language here to be sure
<lisp123_>
Yup and with material consequences for not being exact, given their use in estoeric code
cognemo has joined #commonlisp
dsk has joined #commonlisp
<phoe>
Bike: hmmm
<phoe>
just thinking about "what if restarts weren't DX"
<phoe>
you would still need to be able to encode the rest of the computation in some way, which still requires a CPS transform
<Bike>
yeah, probably.
srhm has joined #commonlisp
lad has joined #commonlisp
amb007 has quit [Read error: Connection reset by peer]
<Bike>
restarts are just a dynamic namespace for functions. don't actually do any control transfer stuff themselves. i forgot.
amb007 has joined #commonlisp
<phoe>
it's easy to define a non-DX restart equivalent, everything control-flow-related is still up to THROW and RETURN-FROM and GO though
<phoe>
and you need to somehow defeat these in order to preserve stacks for CPS
tyson2 has joined #commonlisp
lisp123__ has joined #commonlisp
lisp123_ has quit [Ping timeout: 258 seconds]
<pjb>
Bike: the argument is that they are not because: (let ((c (block cont (lambda (x) (return-from cont x))))) (list (funcall c 42) (funcall c 33))) does not work.
<shka>
i am having problem with azure postgres server and postmodern
<shka>
azure postgres uses special format of the user
<shka>
user@host
<shka>
and i think that this causes in postmodern
<pjb>
If postmodern parses user strings, it's possible. A patch would be in order.
IPmonger has joined #commonlisp
IPmonger has quit [Remote host closed the connection]
selwyn has quit [Read error: Connection reset by peer]
kevingal has joined #commonlisp
hendursa1 has quit [Quit: hendursa1]
hendursaga has joined #commonlisp
<shka>
i will investigate
<Bike>
pjb: they are not what? undelimited? "undelimited" does not mean "indefinite extent". i know blocks don't have indefinite extent and i said as much
kpoeck has joined #commonlisp
attila_lendvai has quit [Remote host closed the connection]
attila_lendvai has joined #commonlisp
<lisp123__>
I'm getting a strange error, but I'm not sure if anyone can point me in the right direction as its obscure
<phoe>
what is the error
<lisp123__>
It is "RESTART1 is a macro, not a function" when I am calling the macro RESTART1
<lisp123__>
Currently my code is 1:1 from the On Lisp
<lisp123__>
Most of it works, except for when trying to work with the very last function
<lisp123__>
expression*
<Bike>
Okay. I fixed all the problems and ran that expression, and then I did (restart1) repeatedly. It returned a bunch of different values and then DONE, so I think it's working.
<lisp123__>
What was the problem?
<Bike>
If you're seeing something different you might just need to recompile it. =defun will define RESTART1 as a macro rather than a function, as PG explains in his book, so you might have an out of date definition of it.
<Bike>
The problems were mostly that PG keeps doing (setq something value) instead of (defvar something value)
<Bike>
if you want to use a top level variable you actually have to define one
<lisp123__>
I loaded the functions with C-x C-e - that wouldn't have been the source of the issues by any chance (you mentioned 'recompile')?
<Bike>
I don't think evaluating rather than compiling would matter, but let me check
<Bike>
er, hang on
<Bike>
you mean you did C-x C-e one by one on each form?
<lisp123__>
Yes
<phoe>
in which order?
<phoe>
I usually use C-x C-k for whole-file compilation
<Bike>
just do C-c C-l to load the whole file at once
<lisp123__>
Just down the page
<Bike>
oh hey, evaluating it did result in the error. let me see
<lisp123__>
yyup - sometimes it does, sometimes it doesn't
<Bike>
I see the problem.
<Bike>
=defun defines restart1 as a macro, as mentioned. However, you have restart1 defined after dft-node, which has a (restart1) form.
<Bike>
So if you load the file sequentially, the macroexpansion of dft-node's body will assume that restart1 is a function, and rewrite it as a CPS call.
<Bike>
which doesn't work obviously.
<lisp123__>
Yay! It works
<lisp123__>
:) Thanks!!!!!
<lisp123__>
Now I know why it worked sometime and not, I must have evaluated restart1 first in those caes
<Bike>
no problem. in the future you might want to default to using slime-compile-and-load-file, C-c C-k in slime
<lisp123__>
You guys are too smart, that was pretty obscure!
<Bike>
although really the good fix is to define restart1 first. i wonder why PG didn't
<lisp123__>
Yeah he had it in the wrong order too
<lisp123__>
It worked for the simple cases, but fell over in the more advanced one that I was having at the end of the file
<lisp123__>
Does order not matter if one uses C-c C-k?
<Bike>
i think PG meant it to be dynamically scoped
rain3 has quit [Quit: Leaving]
<Bike>
that's usually what *earmuffs* mean
<lisp123__>
No he wanted it to not be special
<Bike>
where does it say that?
<lisp123__>
That's why he didn't define it, because he wanted *cont* within the macros to shadow the outer *cont*
<lisp123__>
It is by manipulating *cont* that we will get the effect of continuations. Although *cont* has a global value, this will rarely be the one used: *cont* will nearly always be a parameter, captured by =values and the macros defined by =defun. Within the body of add1, for example, *cont* is a parameter and not the global variable. This distinction is important because these macros wouldn’t work if *cont* were not a local variable. That’
<lisp123__>
s why *cont* is given its initial value in a setq instead of a defvar: the latter would also proclaim it to be special.
<Bike>
okay, well, that's kind of perverse
<phoe>
right?
<Bike>
do not follow PG's example here
<phoe>
a defglobal would not work here because it doesn't allow shadowing
<lisp123__>
Does that work to create global lexically scoped variables?
<phoe>
it *emulates* global lexically scoped variables that can also be shadowed
<phoe>
standard CL has no way of creating those
<lisp123__>
Thanks! And this is 'portable' code?
<phoe>
yes, it should work on all conforming implementations
<lisp123__>
Cool :)
icer has quit [Quit: icer]
kevingal has quit [Remote host closed the connection]
tyson2 has quit [Quit: ERC (IRC client for Emacs 27.2)]
lambdatheultimat has joined #commonlisp
psycomic has quit [Ping timeout: 268 seconds]
psycomic has joined #commonlisp
lambdatheultimat has quit [Read error: Connection reset by peer]
gaqwas has joined #commonlisp
hafat has joined #commonlisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
selwyn has joined #commonlisp
heisig has quit [Quit: Leaving]
<shka>
pjb: i created bug for postmodern
<shka>
because it looks like it
attila_lendvai has quit [Quit: Leaving]
attila_lendvai has joined #commonlisp
random-nick has quit [Ping timeout: 272 seconds]
_whitelogger has joined #commonlisp
<Bike>
basically it does CPS except saves the continuation in a dynamic variable instead of adding a parameter like the usual formulation
<shka>
this is very nice of you, but i need to sleep
<Bike>
good night
<shka>
i will take a look tomorrow
lisp123_ has joined #commonlisp
scymtym has quit [Ping timeout: 272 seconds]
attila_lendvai_ has joined #commonlisp
attila_lendvai has quit [Ping timeout: 272 seconds]
shka has quit [Ping timeout: 258 seconds]
rgherdt has joined #commonlisp
z3t0 has joined #commonlisp
lisp123_ has quit [Remote host closed the connection]
psycomic has quit [Remote host closed the connection]
lisp123_ has joined #commonlisp
lisp123_ has quit [Remote host closed the connection]
lisp123_ has joined #commonlisp
tfeb has joined #commonlisp
scymtym has joined #commonlisp
karlosz has joined #commonlisp
tfeb has quit [Quit: died]
cage has quit [Quit: rcirc on GNU Emacs 27.1]
lisp123_ has quit [Remote host closed the connection]
retropikzel has joined #commonlisp
tyson2 has joined #commonlisp
lisp123_ has joined #commonlisp
attila_lendvai_ has quit [Ping timeout: 258 seconds]
lisp123_ has quit [Ping timeout: 272 seconds]
karlosz has quit [Quit: karlosz]
tfeb has joined #commonlisp
<lad>
Anyone here use emacs/org-mode/babel for common lisp snippets? I seem to have to call "(in-package :my-package)" at the top of every code snippet. Seems each snippet defaults to COMMON-LISP-USER NS. I asked in #org-mode, but didn't get much
pve has quit [Quit: leaving]
lisp123_ has joined #commonlisp
Oddity has joined #commonlisp
tfeb has quit [Quit: died]
<pjb>
lad: it doesn't work if you put a snippet with in-package?
<pjb>
lad: Do you use it with slime or with something else (perhaps bare inferior-lisp? ilisp?)?
<lad>
pjb, hi. I'm using it with slime
<pjb>
lad: you could force the value of slime-buffer-package as a file-local variable.
<lad>
pjb, my very first snippet has (in-package :my-package), but that package isn't auto used in subsequent snippets
<pjb>
lad: i would expect indeed for it not to be used. slime tries to scan the file for in-package forms, but since your file is an org-mode file, not a lisp-mode file, it may break.
<pjb>
Try to edit the mode-line as indicated (use M-x normal-mode RET to reset it).
<lad>
pjb, forcing that does work actually. Everytime I write the file I am prompted if I really want to write because "invalid coding system".
<pjb>
sorry s/8:/8;/
<lad>
pjb, thx that helps a lot.
lisp123_ has quit [Ping timeout: 256 seconds]
<lad>
pjb, actually, i spoke to soon. I don't think it's working actually
<lad>
Looks like I can add :package my-package to each snippet.
lisp123_ has joined #commonlisp
gaqwas has quit [Ping timeout: 265 seconds]
lisp123_ has quit [Read error: Connection reset by peer]
tankrim has quit [Ping timeout: 272 seconds]
<waleee>
if you wanted to redirect output generated by log4cl to a file in the standard *nix-way, aka APP > log.txt and similar, how do you config log4cl?
<lotuseater>
I would say in your implementations rc file. or in emacs
<waleee>
lotuseater: well, yeah, but it still spits out loads of info-level stuff. This if for nyxt if it helps
dsk has quit [Ping timeout: 272 seconds]
<waleee>
A tip on how to either configure it to enable redirections, or how to configure it via (log:config ...) to not produce the logs to a file without clogging stdout with info would be great
<waleee>
aha, :daily did work with :sane et al, I got the impression that it didn't when I tried some stuff
pillton has joined #commonlisp
<lotuseater>
waleee: it helps for me :)
<lotuseater>
I realized just yesterday to also use and learn more log4cl and such
lisp123_ has joined #commonlisp
<lotuseater>
are you working on or using nyxt?
<waleee>
I'm guessing you could work around the initial "loading auto-config.lisp & init.lisp" too if you compile the image with log4cl
<waleee>
lotuseater: just using
<lotuseater>
it's so annoying, seeing the terminal output from Firefox even small time after starting. lots of (always the same) JS exceptions and errors
<lotuseater>
they should use more Elm for runtime safety by types :D
cjb has joined #commonlisp
<lotuseater>
waleee: ah when I remember correctly nyxt starts by default without the normal rc file
<waleee>
ah, you meant eg sbclrc?
<lotuseater>
yes
<waleee>
... I forgot to try it
lisp123_ has quit [Ping timeout: 240 seconds]
<lotuseater>
hm I wonder on which implementations it also runs ..
Kabouik has joined #commonlisp
<lotuseater>
oh damn so much dependencies (I mean all)
frgo has quit [Remote host closed the connection]
<lotuseater>
I just get nyxt 2.0.0 with nix-shell
frgo has joined #commonlisp
retropikzel has quit [Quit: Leaving]
z147 has joined #commonlisp
z147 has quit [Ping timeout: 244 seconds]
yitzi has quit [Quit: Leaving]
<waleee>
lotuseater: jmercouris has a pr on nixpkgs to update it, there's an overlay on an issue at the nyxt repo
pillton has quit [Quit: ERC (IRC client for Emacs 27.2)]
<lotuseater>
haha the commentor name "DieracDelta" :D
tyson2 has quit [Quit: ERC (IRC client for Emacs 27.2)]
tankrim has joined #commonlisp
<lotuseater>
"No, I'm not a function, be careful or you get distributed!"
dsk has joined #commonlisp
<lotuseater>
there's a famous quote by a math prof: "With (mathematical) functions you can do all that is explicitely allowed, with distributions you can do anything that's not explicitely forbidden."
rgherdt has quit [Ping timeout: 240 seconds]
selwyn has quit [Read error: Connection reset by peer]