libera/#commonlisp - IRC Chatlog
Search
7:53:13
doulos05
Yeah, broadly speaking it would be the same COND replicated twice, so I'll eventually break that out into a separate function.
7:54:11
beach
But in the code you have, both IFs can be true. If you stick those cases in a COND, only one can be true.
7:55:20
beach
doulos05: Actually, you may want to join #clschool. This channel is not really meant for newbie questions, though they are tolerated to some extent.
7:59:48
beach
doulos05: So I think you have to make a decision. Either both cases (or all 15-20 cases) can be applicable, and then you can not use COND, or else only one case at a time can be applicable, in which case you should not have two consecutive IFs (or WHENs).
8:04:39
doulos05
Well, the choice is made by the game I'm porting from tabletop. Units have up to 2 movement options. The secondary movement options list is shorter than the primary movements option list, but there is considerable overlap.
8:05:46
doulos05
For now, I don't need the first WHEN because I've only implemented the two simplest movement options (one of which is always a secondary option). But eventually I'll need to handle both options.
8:08:55
Nilby
doubos05: i think effective use of format is a esoteric subject, but i'd be glad to explain weird format strings
10:56:21
Nilby
nobody wants to write cdaadr etc explictly, but probably the humble posix shell is actually used more for metaprogramming
12:44:35
jackdaniel
if anyone wants a mind-bending expierience I'm recommending implementing :arguments for define-method-combination - we expand body and arguments twice then - once for the method combination function and once for the effective method
13:51:13
pjb
contrapunctus: programmers able to write backquote forms 3 levels deep. `(… `(… `(… ,,,x …) …) …)
13:51:37
jackdaniel
contrapunctus: there is a trivia regarding a three star programmer (related to C - you dereference pointers to pointers to pointers)
13:52:07
phoe
two backquotes, you're a lisp wizard capable of writing backquoted forms that generate backquote stuff
13:52:07
jackdaniel
it is adapted to common lisp. check out a phrase three star programmer in your search engine
14:12:52
scymtym
i know this is not specified but what do people think (with-input-from-string (stream "hello" :start 2) (file-position stream)) should return? nil or 0 or 2 or something else?
14:15:31
phoe
if you are willing to put in the work to define and document the extension then 2 would be very nice to have, if not then NIL is a sane default
14:15:37
scymtym
i think 0 and 2 are both sane. i have a (weak) argument for preferring one over the other but i would like to hear other opinions first
14:17:18
jackdaniel
I read (wifs (stream string :start 2) ...) as a virtual version of (with-open-file (stream #<stringoid>) (setf (file-position stream 2)) ,@body)
14:17:42
phoe
0 feels wrong because (... "hello" :start 2) is a different thing than (... "llo") even if they seem to produce equivalent results in the body
14:18:25
phoe
if you open a file containing "hello" and then set the file position to 2 then the file position is going to be 2
14:19:49
phoe
scymtym: do you plan on supporting the two-arg FILE-POSITION for string input streams?
14:20:56
phoe
if :START is set to 0, then should the two-arg FILE-POSITION be able to rewind beyond that and access earlier characters?
14:21:29
phoe
or is :START and :END supposed to work like in SUBSEQ and effectively pass only a slice of the string into the stream
14:21:51
scymtym
phoe: setting the file position is a consideration, yes. i'm thinking about the user's perspective. in particular what WSCL could say in this regard
14:26:27
scymtym
i realize the issue is pretty niche, but it can cause actual inconveniences: https://github.com/s-expressionists/Eclector/issues/75
14:35:51
scymtym
phoe: sure, you can work around the issue but it seems like an unnecessary point of divergence
14:36:52
phoe
this sounds like a very good WSCL issue with very poor chances of resolving if in favor of one common definition of "what does a file position mean when applied to a string"
16:59:23
contrapunctus
beach: should I add a TLS library to the suggested projects? https://github.com/shrdlu68/cl-tls/ may be a starting point...