<gilberth>
FORMAT is not printf. and when it borrows it does so from FORTRAN not C.
HerlockSholmes has joined #commonlisp
<mfiano>
Luckily I only know enough printf for basic string interpolation in POSIX shell.
jmdaemon has joined #commonlisp
akoana has quit [Quit: leaving]
donleo has quit [Ping timeout: 256 seconds]
<gilberth>
mfiano: I find it silly. What you want is not that uncommon and could have been the behavior of ~D. I mean, really, "00-5" is not a digital number to begin with, is it? Especially considering that padding on the pure textual level is always available with ~< ~>.
<gilberth>
I was pulling my hair over this very task once myself and finally caved in and write a function to do that for me.
<mfiano>
Ok, at least I'm not alone, because between you and me, this has happened more than twice for this exact use case before, and I have done the same. I just, can never remember and I waste time trying and reading, which, the way the directives are laid out in the dictionary pages....
trocado has quit [Remote host closed the connection]
Gleefre has quit [Remote host closed the connection]
Gleefre has joined #commonlisp
certainty has joined #commonlisp
<gilberth>
I find it a bit evil because ~D doesn't do here what one might think. When I first came across it with using e.g. "~6,'0D" and got "0000-4" and believed in a bug.
<gilberth>
However, when padchar is something else you might want to have e.g. "****-4" or " -4".
<gilberth>
But the latter could always have been achieved with ~< ~>.
<mfiano>
Yes. FORMAT is a mishmash of features in no cohesive form. Just look at the padding parameter across printing directives
<edgar-rft>
what I find more worrying is that (format nil "~3,'0d" -5) => "0-5" returns something that is READ-FROM-STRING as a symbol and *not* an integer
pve has quit [Quit: leaving]
<gilberth>
It's still great. My favorite is ~@< ... ~:@>
<mfiano>
And these very directives are what I want to use FORMAT most for. Therefor I rarely use it for transforming object representations.
<aeth>
wow, I have never used format ~D with leading 0s on a negative number before
<gilberth>
edgar-rft: Yes, this is what I meant. I doesn't make sense to use ~D and not get an integer representation. But, as I pointed out: What if padchar = #\space ?
<gilberth>
* It
<gilberth>
aeth: Indeed. It's rather rare that I zero pad decimal numbers. But I zero pad hex numbers all the time.
<edgar-rft>
everyone should use sideral time in nanosecond precision :-)
xlymian has quit [Ping timeout: 246 seconds]
HerlockSholmes has quit [Remote host closed the connection]
jmdaemon has quit [Ping timeout: 268 seconds]
jmdaemon has joined #commonlisp
dajole has joined #commonlisp
jfh_ has joined #commonlisp
ahc has joined #commonlisp
certainty has joined #commonlisp
certainty has quit [Ping timeout: 268 seconds]
jmdaemon has quit [Ping timeout: 256 seconds]
Alfr has quit [Remote host closed the connection]
Alfr has joined #commonlisp
yitzi has quit [Ping timeout: 256 seconds]
yitzi has joined #commonlisp
certainty has joined #commonlisp
certainty has quit [Ping timeout: 240 seconds]
ec has quit [Ping timeout: 264 seconds]
jmdaemon has joined #commonlisp
ec has joined #commonlisp
rtypo has quit [Ping timeout: 268 seconds]
Oladon has quit [Quit: Leaving.]
yitzi has quit [Remote host closed the connection]
certainty has joined #commonlisp
bh34e5 has quit [Ping timeout: 246 seconds]
certainty has quit [Ping timeout: 256 seconds]
tyson2 has quit [Remote host closed the connection]
ahc has quit [Quit: Client closed]
certainty has joined #commonlisp
ec has quit [Read error: Connection reset by peer]
ec has joined #commonlisp
certainty has quit [Ping timeout: 256 seconds]
sirufer has quit [Server closed connection]
sirufer has joined #commonlisp
avocadoist has quit [Ping timeout: 260 seconds]
triffid has quit [Ping timeout: 264 seconds]
chiselfuse has quit [Ping timeout: 264 seconds]
X-Scale has joined #commonlisp
chiselfuse has joined #commonlisp
triffid has joined #commonlisp
chiselfuse has quit [Remote host closed the connection]
habamax has quit [Ping timeout: 256 seconds]
chiselfuse has joined #commonlisp
habamax has joined #commonlisp
edr has quit [Quit: Leaving]
habamax has quit [Remote host closed the connection]
certainty has joined #commonlisp
certainty has quit [Ping timeout: 245 seconds]
X-Scale has quit [Quit: Client closed]
habamax has joined #commonlisp
Pixel_Outlaw has joined #commonlisp
Lycurgus has quit [Server closed connection]
Lycurgus has joined #commonlisp
certainty has joined #commonlisp
certainty has quit [Ping timeout: 268 seconds]
reb has quit [Ping timeout: 256 seconds]
waleee has quit [Ping timeout: 268 seconds]
czy has joined #commonlisp
certainty has joined #commonlisp
certainty has quit [Ping timeout: 268 seconds]
rendar has quit [Server closed connection]
chomwitt has joined #commonlisp
dcb has quit [Ping timeout: 256 seconds]
dcb has joined #commonlisp
czy has quit [Remote host closed the connection]
smlckz has joined #commonlisp
smlckz has quit [Changing host]
smlckz has joined #commonlisp
dcb has quit [Client Quit]
certainty has joined #commonlisp
jeffrey has quit [Server closed connection]
jeffrey has joined #commonlisp
certainty has quit [Ping timeout: 268 seconds]
bjorkintosh has quit [Server closed connection]
bjorkintosh has joined #commonlisp
bjorkintosh has joined #commonlisp
bjorkintosh has quit [Changing host]
zetef has joined #commonlisp
notzmv has quit [Ping timeout: 245 seconds]
certainty has joined #commonlisp
certainty has quit [Ping timeout: 260 seconds]
saturn2 has quit [Ping timeout: 252 seconds]
saturn2 has joined #commonlisp
habamax has quit [Ping timeout: 246 seconds]
Pixel_Outlaw has quit [Remote host closed the connection]
gxt has quit [Remote host closed the connection]
gxt has joined #commonlisp
habamax has joined #commonlisp
zetef has quit [Ping timeout: 246 seconds]
certainty has joined #commonlisp
makomo has joined #commonlisp
certainty has quit [Ping timeout: 246 seconds]
igemnace has joined #commonlisp
zetef has joined #commonlisp
pve has joined #commonlisp
certainty has joined #commonlisp
cinerion has quit [Server closed connection]
cinerion has joined #commonlisp
habamax has quit [Quit: ERC 5.5.0.29.1 (IRC client for GNU Emacs 29.1.90)]
smlckz_ has quit [Server closed connection]
jonatack has quit [Read error: Connection reset by peer]
jonatack has joined #commonlisp
jonatack has quit [Read error: Connection reset by peer]
jonatack has joined #commonlisp
zetef has quit [Ping timeout: 256 seconds]
shka has joined #commonlisp
habamax has joined #commonlisp
thollief has joined #commonlisp
danza has joined #commonlisp
donleo has joined #commonlisp
jrm has quit [Ping timeout: 240 seconds]
kopiyka_ has quit [Remote host closed the connection]
kopiyka has joined #commonlisp
jrm has joined #commonlisp
rgherdt has joined #commonlisp
notzmv has joined #commonlisp
attila_lendvai has joined #commonlisp
anticrisis has quit [Read error: Connection reset by peer]
alip has quit [Server closed connection]
alip has joined #commonlisp
zephyr has quit [Server closed connection]
zephyr has joined #commonlisp
Lord_of_Life has quit [Ping timeout: 268 seconds]
Gleefre has quit [Ping timeout: 250 seconds]
Lord_of_Life has joined #commonlisp
bendersteed has joined #commonlisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
danza has quit [Ping timeout: 260 seconds]
mgl_ has joined #commonlisp
dino_tutter has joined #commonlisp
danse-nr3 has joined #commonlisp
igemnace has quit [Read error: Connection reset by peer]
leeb has quit [Server closed connection]
leeb has joined #commonlisp
younder has quit [Remote host closed the connection]
igemnace has joined #commonlisp
attila_lendvai has quit [Ping timeout: 260 seconds]
attila_lendvai has joined #commonlisp
X-Scale has joined #commonlisp
bendersteed has quit [Quit: bendersteed]
bendersteed has joined #commonlisp
szkl has joined #commonlisp
Brucio-61 has quit [Ping timeout: 268 seconds]
Brucio-61 has joined #commonlisp
danse-nr3 has quit [Read error: Connection reset by peer]
danse-nr3 has joined #commonlisp
younder has joined #commonlisp
Shinmera has quit [Server closed connection]
Shinmera has joined #commonlisp
lieven has quit [Server closed connection]
lieven has joined #commonlisp
dajole has quit [Quit: Connection closed for inactivity]
dmho has quit [Server closed connection]
dmho has joined #commonlisp
X-Scale has quit [Ping timeout: 250 seconds]
random-nick has joined #commonlisp
gilberth has quit [Server closed connection]
Colleen has quit [Server closed connection]
Colleen has joined #commonlisp
doulos05 has quit [Server closed connection]
doulos05 has joined #commonlisp
rendar has joined #commonlisp
rendar has quit [Changing host]
rendar has joined #commonlisp
puke has quit [Ping timeout: 246 seconds]
copec has quit [Server closed connection]
copec has joined #commonlisp
ym has joined #commonlisp
rtypo has joined #commonlisp
attila_lendvai has quit [Ping timeout: 268 seconds]
seanw has quit [Remote host closed the connection]
seanw has joined #commonlisp
grawlinson has quit [Ping timeout: 252 seconds]
attila_lendvai has joined #commonlisp
grawlinson has joined #commonlisp
_cymew_ has joined #commonlisp
puke has joined #commonlisp
jon_atack has joined #commonlisp
jonatack has quit [Ping timeout: 252 seconds]
avocadoist has joined #commonlisp
tyson2 has joined #commonlisp
remexre has quit [Server closed connection]
remexre has joined #commonlisp
pok has quit [Server closed connection]
pok has joined #commonlisp
pok has joined #commonlisp
pok has quit [Changing host]
attila_lendvai has quit [Ping timeout: 256 seconds]
szkl has quit [Quit: Connection closed for inactivity]
danse-nr3 has quit [Ping timeout: 260 seconds]
Gleefre has joined #commonlisp
zetef has joined #commonlisp
habamax has quit [Quit: ERC 5.5.0.29.1 (IRC client for GNU Emacs 29.1.90)]
danse-nr3 has joined #commonlisp
msavoritias has joined #commonlisp
larix has joined #commonlisp
larix1 has joined #commonlisp
ezakimak has quit [Server closed connection]
ezakimak has joined #commonlisp
kevingal has joined #commonlisp
kevingal_ has joined #commonlisp
szkl has joined #commonlisp
inline has quit [Quit: Leaving]
lucasta has joined #commonlisp
attila_lendvai has joined #commonlisp
attila_lendvai has quit [Remote host closed the connection]
attila_lendvai has joined #commonlisp
waleee has joined #commonlisp
yitzi has joined #commonlisp
inline has joined #commonlisp
larix1 has quit [Ping timeout: 256 seconds]
larix has quit [Ping timeout: 268 seconds]
jmdaemon has quit [Ping timeout: 256 seconds]
<beach>
SBCL rejects this definition: (DEFUN FOO (X &OPTIONAL (X (1+ X))) X) but where does it say in the standard that this is not allowed?
<beach>
I can see why it is not allowed to have a variable occur twice as a required parameter, but I see no reason why there can't be duplication elsewhere.
<beach>
... unless of course the standard says so.
danse-nr3 has quit [Read error: Connection reset by peer]
danse-nr3 has joined #commonlisp
<lieven>
beach: maybe the issue is that referring to previous arguments is only allowed in boa lambda lists?
<beach>
Maybe so, but I would like to know where in the standard it says so.
<beach>
I mean, you can definitely refer to previous parameters.
<lieven>
yes, you're right
attila_lendvai has quit [Ping timeout: 256 seconds]
<mfiano>
I am sure it says somewhere.
<beach>
So (defun foo (x &optional (y (1+ x))) (+ x y)) is fine.
<mfiano>
I mean, in this case, the issue is that in OLL's,, the binding cannot be referenced before it is established, and we do enforce a left to right evaluation order.
<mfiano>
Right?
cage has joined #commonlisp
<beach>
No, I don't think so.
<beach>
There is no reference before a binding is established.
<mfiano>
I see now
<beach>
I mean (let* ((x ...) (x (1+ x))) x) is fine.
<mfiano>
I missed the previous symbol attempting to be shadowed
tyson2 has quit [Read error: Connection reset by peer]
zetef has quit [Remote host closed the connection]
<mfiano>
"may rely on the fact that no other parameter variable has yet been bound (including its own parameter variable)."
<mfiano>
could this possibly be an SBCL bug?
<beach>
Where is that phrase from?
<lieven>
3.4.1 spec of initform
<beach>
OK, so that basically says that things are done in a way similar to LET*.
<beach>
And that's the problem I have. Why this additional restriction in lambda lists, but not in LET*.
<Alfr>
mfiano, otoh, it also says: form may refer to any parameter variable to the left of the specifier in which the init-form appears
waleee has quit [Ping timeout: 268 seconds]
<Alfr>
You two might have unearthed a genuine contradiction here.
<beach>
Alfr: Why?
<mfiano>
Not entirely...
<beach>
Alfr: I mean, "I don't see any contradiction, where do you see one?"
<mfiano>
This is simply imposing an order of evaluation
<mfiano>
Without it there would be quite an ambiguity. Where do you see a contradiction?
<beach>
Order of evaluation and environment augmentation.
<mfiano>
Yes
<Alfr>
The required x maybe referred to in the init-form, because it appears to the left, and x (optional) may not be bound.
<mfiano>
There is further data to go along with that snippet
<beach>
Alfr: It is not bound when (1+ x) is evaluated, but it is after that.
<mfiano>
f &optional is present, the optional parameter specifiers are those following &optional up to the next lambda list keyword
<mfiano>
If*
<mfiano>
Does that mean, that initform evaluation can only look back at the previous optional initforms or suppliedp values?
<mfiano>
That with the previous wording, I mean
<Alfr>
mfiano, yes. And beach's original problem is: (x &optional (x (1+ x)))
<beach>
It does not look back to any initforms; only to previous parameters.
<mfiano>
what kind of previous parameters. what wording are you seeing exactly?
<Alfr>
Yes, but it states that the init-form may reference previous params.
<Alfr>
mfiano, Whenever any init-form is evaluated for any parameter specifier, that form may refer to any parameter variable to the left of the specifier in which the init-form appears, including any supplied-p-parameter variables, and may rely on the fact that no other parameter variable has yet been bound (including its own parameter variable).
<beach>
It seems clear to me that allowing duplicate parameters is semantically sound, so the only valid reason to reject that code is if the standard explicitly adds this restriction.
<mfiano>
Yes, that is the part I think I understand, and pieced with the 3.4.1.2 description, makes it illegal to do what beach wants, unless I misunderstand.
<beach>
I don't see any clue in 3.4.1.2.
<Alfr>
mfiano, I don't see why 3.4.1.2 would prevent or allow reuse of x in the optional part.
<mfiano>
I think I see the problem
<mfiano>
And why it is perhaps misinterpreted by both
Guest63 has joined #commonlisp
<beach>
Alfr: I agree.
<mfiano>
3.4.1.2 describes the semantics of initform evaluation in terms of previous parameters.
<beach>
Oh?
<beach>
I don't think so.
<mfiano>
The first sentence describes optional parameter specifiers as those only that follow the delimiter symbol, and then further refers to them as optional parameters generally, and then parameters, more generally.
<Guest63>
Sorry to disturb you guys, may someone tell me why are new lines aren't inserted upon evaluation of (format t "~_ ~S ~_ ~S" a a)?
vjalmr has joined #commonlisp
<mfiano>
Is this the case, and a need for WSCL, or am I insane?
<beach>
mfiano: You are right in that both "parameter" and "parameter specifier" are used interchangeably.
<mfiano>
a key example is "or to nil if no init-form appears in the parameter specifier"
<mfiano>
a required parameter is obviously not being talked about here, yet they keep eliding wording about the specificity of parameters
<mfiano>
Maybe I am bonkers and reading too much today
<beach>
Interesting discussion, but I still see no reason why my example should be rejected. I guess I'll wait for someone to come up with the right passage in the standard.
<beach>
Until then, I am going to allow it.
<beach>
... in the library I am working on.
<mfiano>
I'm sorry
<mfiano>
There are a lot of WSCL issues to aggregate
tyson2 has joined #commonlisp
<beach>
If parameters can be duplicated, declarations apply to the rightmost one, so one has to traverse the parameters from right to left for associating them with declarations.
<mfiano>
10 years was a long time but not enough for an eternity.
Guest63 has quit [Quit: Client closed]
<beach>
Sure, there is a lot of WSCL work to do.
<beach>
Then, variables introduced by LET* also has to be traversed from right to left for declaration associations.
<beach>
s/has/have/
<beach>
In (LET* ((X ...) (X (1+ X))) (DECLARE (SPECIAL X)) X) it is the variable in the second binding that is special.
<beach>
... unless it is globally special of course.
Gleefre has quit [Remote host closed the connection]
Gleefre has joined #commonlisp
<mfiano>
My main complaint about the standard is that I am often refuted by some passage in a very unobvious place, and one has to take handfuls of tiny morsels when researching a key feature. I would like to see a reorganization to address that.
<mfiano>
I am not sure how that may be done, or if it is even possible.
<mfiano>
A very technical and mechanical description of key parsing processes from start to finish, might go a long way, even if redundant by the dictionary prose.
<mfiano>
Apart from implementations defining new delimiters, I am not sure it would get much in the way of the language flexibility, in this specific case, anyway
<beach>
I tend to agree. Then again, as I often point out, the standard is mainly meant for people implementing the language, and those people probably don't mind that much. They can get it right eventually. This is why I would like to see a language reference, probably as a web site, which can then have duplicated passages to make it easier for the application programmer.
<beach>
I said "mainly", not "purely". And notice the keyword "knowledgeable".
<mfiano>
Ah ok, fair.
<beach>
But either way, whether that is the purpose or not, I am of the opinion that the document favors compactness (it is big enough as it is) over easy access to information.
<mfiano>
Agreed.
<mfiano>
KMP and others have stated they were rushed and had to release something. It was already a long time and a lot of US funding
<mfiano>
CLOS didn't go how he had hoped, IIRC
<beach>
I see. I regularly have an (almost) irresistible desire to rewrite it. But then I come to my senses.
<mfiano>
If you want an organic document though, this channel is probably not at the front of your attention
<beach>
What do you mean?
<mfiano>
trade-offs to ensure portability of computer software for a long time to come.
<mfiano>
by having a immutable document
<beach>
Yes, I see.
<mfiano>
whereas most other languages will modify their 'standard' because of a reference implementation change, or the equivalent anyway.
<beach>
I wouldn't redefine the language. Or at least not much.
semarie has quit [Ping timeout: 240 seconds]
<mfiano>
To be fair, "the standard is mainly meant for people implementing the language", is certainly true, but, there are a lot of things an application developer cannot find the answer to in order to write correct, not to mention, conforming code, without referencing this document. Currently, anyway. We have talked about what we need to do.
<mfiano>
So I find that sentence slightly misleading, because we do not have a better resource yet.
<mfiano>
We have a collection of them, that all lead back to the document in question for the things you often need to know that they leave out.
danse-nr3 has quit [Ping timeout: 256 seconds]
danse-nr3 has joined #commonlisp
loke has joined #commonlisp
<Alfr>
mfiano, re 3.4.1.2's use of parameter ... leaving aside the one mention of required parameter, it's either optional parameter specifier or parts of it, i.e. parameter variable, an init-form or the supplied-p part.
<mfiano>
Yeah
<mfiano>
Some of it makes more sense, but some of it could certainly be spelled out to well, say what they mean.
<Alfr>
Ah, okay.
<mfiano>
I'm actually in the process of cleaning up some old text documents and parsing them for archival purposes/variety of storage purposes, so this may find its way on my desk at some point
<mfiano>
WSCL additions, that is, among making that community reference beach and I have been brainstorming for a year or more
szkl has quit [Quit: Connection closed for inactivity]
jcowan has quit [Server closed connection]
jcowan has joined #commonlisp
tyson2` has joined #commonlisp
saturn2 has quit [Ping timeout: 246 seconds]
semarie has joined #commonlisp
Pixel_Outlaw has joined #commonlisp
saturn2 has joined #commonlisp
HerlockSholmes has joined #commonlisp
bendersteed has quit [Quit: bendersteed]
ym has quit [Quit: Leaving]
larix1 has joined #commonlisp
larix has joined #commonlisp
yitzi has quit [Remote host closed the connection]
larix has quit [Ping timeout: 256 seconds]
larix1 has quit [Ping timeout: 260 seconds]
micro has quit [Server closed connection]
micro has joined #commonlisp
gilberth has joined #commonlisp
larix1 has joined #commonlisp
larix has joined #commonlisp
zetef has joined #commonlisp
lagash has quit [Ping timeout: 245 seconds]
lagash has joined #commonlisp
dino_tutter has quit [Ping timeout: 260 seconds]
lucasta has quit [Ping timeout: 256 seconds]
tyson2` has quit [Remote host closed the connection]
tyson2 has quit [Remote host closed the connection]
zetef has quit [Ping timeout: 246 seconds]
zetef has joined #commonlisp
cage has quit [Remote host closed the connection]
tyson2 has joined #commonlisp
saturn2 has quit [Ping timeout: 246 seconds]
attila_lendvai has joined #commonlisp
saturn2 has joined #commonlisp
zetef has quit [Ping timeout: 260 seconds]
mgl_ has quit [Ping timeout: 260 seconds]
igemnace has quit [Read error: Connection reset by peer]
yitzi has joined #commonlisp
zetef has joined #commonlisp
igemnace has joined #commonlisp
HerlockSholmes has quit [Ping timeout: 268 seconds]
|3b| has quit [Server closed connection]
trocado has joined #commonlisp
|3b| has joined #commonlisp
cstml has quit [Quit: WeeChat 2.3]
stylewarning has quit [Server closed connection]
stylewarning has joined #commonlisp
cstml has joined #commonlisp
sjl has joined #commonlisp
_cymew_ has quit [Ping timeout: 260 seconds]
danse-nr3 has quit [Ping timeout: 260 seconds]
zetef has quit [Ping timeout: 256 seconds]
dino_tutter has joined #commonlisp
dajole has joined #commonlisp
Catie has quit [Server closed connection]
Catie has joined #commonlisp
dstein64- has joined #commonlisp
dstein64- has quit [Client Quit]
dstein64- has joined #commonlisp
dstein64 has quit [Ping timeout: 246 seconds]
dstein64- is now known as dstein64
tyson2 has quit [Remote host closed the connection]
Posterdati has quit [Remote host closed the connection]
Posterdati has joined #commonlisp
amb007 has quit [Ping timeout: 256 seconds]
amb007 has joined #commonlisp
mgl_ has joined #commonlisp
rakka has quit [Server closed connection]
rakka has joined #commonlisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
equwal has quit [Server closed connection]
glozzom has quit [Server closed connection]
dcb has joined #commonlisp
equwal has joined #commonlisp
glozzom has joined #commonlisp
<BrokenCog>
whlie ago posted an issue with SBCL using drakma on Windows10 - http-request was failing with an error vaguely related to usocket. Turns out it's a problem with parameters. usocket needs a ':connect-timeout nil' passed and it works.
waleee has joined #commonlisp
HerlockSholmes has joined #commonlisp
khrbtxyz has quit [Ping timeout: 260 seconds]
larix1 has quit [Remote host closed the connection]
larix has quit [Remote host closed the connection]
attila_lendvai has quit [Ping timeout: 256 seconds]