<beach>
I don't understand the reference to "store variables" in the second paragraph of the description. Can someone explain?
jrm has joined #commonlisp
<beach>
From the "Notes:" section, it seems that this paragraph cold refer to only the two special cases when newvalue produces a number of values other than 1. No?
<beach>
... i.e. 0 values or more than 1 value.
<pjb>
beach: it's explained in get-setf-expansion IIRC.
<pjb>
as store-vars
<beach>
That I know.
<beach>
I am asking why there is a reference to it here.
<pjb>
That's because shiftf may work on multi-valued places.
<beach>
It seems to me that "the number of store variables" could be replaced by "1".
<beach>
Not according to the Notes.
<pjb>
(let ((a 'a) (b 'b) (c 'c) (d 'd)) (shiftf (values a b) (values c d) (values 1 2)) (list a b c d)) #| --> (c d 1 2) |#
<pjb>
In general places can be multi-valued.
<beach>
Then the Notes are wrong.
<beach>
Can you please read the Notes!
<pjb>
Yes. the "roughly" ignores multiple values.
<beach>
Not according to the "except that..."
<pjb>
That saidd, rotatef explicitely says "If a place produces more values than there are store variables, the extra values are ignored.".
<pjb>
Oh, but shiftf says the same: "If newvalue produces more values than there are store variables, the extra values are ignored."
<pjb>
So, as I said, in general, places can be multi-valued, but rotatef and shiftf only work with the primary value.
<pjb>
My example is an extension.
<pjb>
but it works in abcl ccl clisp ecl and sbcl.
<pjb>
Oh, it's more value than store variables, not more than 1. So yes, both rotatef and shift works on multiple values.
<pjb>
So (let ((a 'a) (b 'b) (c 'c) (d 'd)) (shiftf (values a b) (values c d) (values 1 2)) (list a b c d)) #| --> (c d 1 2) |# is indeed conforming.
<pjb>
And the notes way too simplified.
<beach>
This is a case for WSCL. This page doesn't explicitly (enough) state that each place can produce and receive multiple values. And, as pointed out, the Notes section is way off.
<beach>
Every time the page mentions "values" in plural form, it could refer just to the fact that there can be more than one place. Plus, the parameter is called NEWVALUE, suggesting a single value.
Oladon has quit [Quit: Leaving.]
OlCe has joined #commonlisp
euandreh has quit [Ping timeout: 245 seconds]
<beach>
Shinmera: I am looking at the documentation for Parachute, and I notice an asymmetry between IS and IS-VALUES. But I guess I must be misunderstanding the latter.
<beach>
With IS, the first argument is the comparator, the second is the expected value, and the third is the form to evaluate to get the expected value.
<beach>
With IS-VALUES, it looks to me like the form is first, then the comparator, and last the expected value(s). No?
<doulos05_>
I have some lists (of units in a game) that I need to merge together into a single "turn order" list for this round of the game.
<doulos05_>
But the thing is, these lists will almost never be of equal length. I feel like I could use a loop here (?), but I'm not really sure where to begin writing the code.
<doulos05_>
Teams take turns adding a unit to the initiative. If a team ever has 2x the number of units left to add, they have to add 2. If they have 3x, they add 3, etc.
<doulos05_>
turn taking is determined by an initiative roll, which I have working code for.
<doulos05_>
So basically I need to pop units off each teams list one, two, or three at a time based on the length of the other team's list.
<beach>
I am afraid I have no idea what that means. Perhaps someone who knows more about games can help. I was expecting something like "both lists are sorted, ...".
<doulos05_>
Imagine team A has 3 units and team B has 4 and team A has to move first, the list would be (A B B A B B A). If B has to move first, it would be (B A B A B B A).
euandreh has joined #commonlisp
herjazz has joined #commonlisp
Gleefre has joined #commonlisp
bjorkintosh has quit [Read error: Connection reset by peer]
bjorkintosh has joined #commonlisp
bjorkintosh has joined #commonlisp
bjorkintosh has quit [Changing host]
karlosz has joined #commonlisp
thollief has joined #commonlisp
dino_tutter has joined #commonlisp
mgl has joined #commonlisp
mm007emko has joined #commonlisp
Lord_of_Life has quit [Ping timeout: 245 seconds]
Lord_of_Life has joined #commonlisp
habamax has joined #commonlisp
msavoritias has joined #commonlisp
jmdaemon has quit [Ping timeout: 246 seconds]
dinomug has quit [Remote host closed the connection]
mgl has quit [Ping timeout: 246 seconds]
perrierjouet has joined #commonlisp
Inline has joined #commonlisp
mm007emko has quit [Quit: Connection closed]
karlosz has quit [Quit: karlosz]
Helmholtz1 has joined #commonlisp
<Helmholtz1>
What has happened to MOCL implementation?
random-nick has joined #commonlisp
tyson2 has joined #commonlisp
Helmholtz1 has quit [Remote host closed the connection]
<pjb>
It was a commercial implementation. We can assume they couldn't get enough customers, so they folded.
<pjb>
Instead, use ecl.
OlCe has quit [Ping timeout: 272 seconds]
cage has joined #commonlisp
<Shinmera>
beach: I think so. I rarely use it
<Shinmera>
beach: I think the rationale was the variadic nature of the values? Not sure anymore, it's been years.
Helmholtz1 has joined #commonlisp
<Helmholtz1>
pjb, thanks, do CCL binaries not depend on glibc?
<green_>
I'm struggling with all of the time libraries. AFAICT, there's no way to ask for the universal-time (or unix-time) for a specific date/time+location (eg. America/New_York). You need to know the timezone for the date+location. Does this sound familiar to anyone?
<pjb>
Helmholtz1: you can use ldd to see that. or otool on macos: otool -L /usr/local/src/ccl-git/dx86cl64
<Helmholtz1>
what would be the reason of someone choosing CCL over SBCL~>
<Helmholtz1>
s/~>/?
<pjb>
Better Objective-C / Cocoa support on macOSX.
<pjb>
The implementation sources are more understandable too.
<Helmholtz1>
👍
Alfr has quit [Quit: Leaving]
Alfr has joined #commonlisp
waleee has joined #commonlisp
Helmholtz1 has quit [Quit: WeeChat 3.8]
karlosz has joined #commonlisp
notzmv has quit [Ping timeout: 260 seconds]
Josh_2 has joined #commonlisp
puchacz has joined #commonlisp
Gleefre has quit [Remote host closed the connection]
Inline has quit [Ping timeout: 272 seconds]
Inline has joined #commonlisp
Gleefre has joined #commonlisp
herjazz has quit [Quit: leaving]
McParen has joined #commonlisp
attila_lendvai has joined #commonlisp
jrm has quit [Read error: Connection reset by peer]
jrm2 has joined #commonlisp
jrm2 is now known as jrm
waleee has quit [Ping timeout: 240 seconds]
karlosz has quit [Quit: karlosz]
habamax has quit [Quit: ERC 5.5.0.29.1 (IRC client for GNU Emacs 29.0.92)]
<semz>
better out-of-memory handling is another reason, especially on systems without memory overcommitting
Noisytoot has quit [Ping timeout: 272 seconds]
Noisytoot has joined #commonlisp
pranavats has joined #commonlisp
pranavats has left #commonlisp [Disconnected: Replaced by new connection]
pranavats has joined #commonlisp
igemnace has joined #commonlisp
kevingal has joined #commonlisp
OlCe has joined #commonlisp
dino_tutter has quit [Ping timeout: 272 seconds]
waleee has joined #commonlisp
Inline has quit [Ping timeout: 246 seconds]
jan_ has joined #commonlisp
jan_ has joined #commonlisp
Inline has joined #commonlisp
son0p has quit [Ping timeout: 272 seconds]
kevingal has quit [Ping timeout: 272 seconds]
jonatack has quit [Ping timeout: 272 seconds]
Gleefre has quit [Remote host closed the connection]
Gleefre has joined #commonlisp
waleee has quit [Ping timeout: 245 seconds]
<green_>
re: my timezone question.. This is the only way I can see how to do it (on Linux): (- (date-time-parser:parse-date-time (uiop:run-program "date --date='TZ=\"America/New_York\" 09:00 Jan 1 2023'" :output '(:string))) (encode-universal-time 0 0 0 1 1 1970 0))
<green_>
This will account for daylight savings time on the date in question. Surprised that no CL library seems to handle this.
tyson2 has quit [Remote host closed the connection]
<mfiano>
You might find the CL book Calendrical Calculations handy. Apart from local-time, which I do admit is lacking in places, I think most people just roll their own ad-hoc solutions. Calendrical calculations are hard, especially with all the different standards for a specific calendar model.
<Nilby>
green_: I have code that can get the seconds offset from UTC for the current timezone on unix and windows, but setting the timezone in an already running program, knowing what timezones are availible, getting information for a specific timezone without setting it, is more difficult portably
<mfiano>
For example, there are different standards just for dealing with leap quantities.
attila_lendvai has quit [Read error: Connection reset by peer]
attila_lendvai has joined #commonlisp
McParen has left #commonlisp [#commonlisp]
<green_>
Thanks mfiano and Nilby. I'm using a web api that takes unix timestamps. I need to generate unix timestamps for arbitrary dates/times in my locale (America/Toronto)
<green_>
Shelling out to the linux 'date' command seems to be the best choice at the moment.
Oladon has joined #commonlisp
tyson2 has quit [Read error: Connection reset by peer]
<ixelp>
GitHub - ak-coram/cl-zoneinfo: Time zone information for Common Lisp projects compiled from the IANA time zone database
euandreh has joined #commonlisp
mgl has joined #commonlisp
jmdaemon has joined #commonlisp
<skeemer>
people i wonder how is commonlisp more interactive wrt racket or other scheme variants?
<skeemer>
i mean is there some kind of advantage in terms of how the language works?
son0p has joined #commonlisp
<jackdaniel>
skeemer: scheme does not specify that functions may be redefined, although I think that some scheme variants allow that - that's one example
<jackdaniel>
common lisp has well-defined redefinition semantics, i.e change-class is a specified operator etc
<jackdaniel>
in other words scheme was not specified with runtime redefinitions in mind, while common lisp was
<skeemer>
jackdaniel, doesn't this allow to do naughty things that shouldn't be done ?
<jackdaniel>
like?
<skeemer>
i mean what is a use case of function redefinition?
<|3b|>
being interactive?
<skeemer>
i racket i can define twice a function and only the last definition gets applied
<jackdaniel>
you have a running application deployed on the server
<skeemer>
ok
<jackdaniel>
something is wrong, a bug of a sort. you may redefine the buggy function and without any downtime the bug is fixed
<ixelp>
The Remote Agent Experiment: Debugging Code from 60 Million Miles Away - YouTube
<skeemer>
jackdaniel, ok so basically the common lisp interpreter/ environment is going to include just that compiled bit ?
<jackdaniel>
the old function will be replaced with the new one in the running application; that's the "interactivity" part
<skeemer>
ohhh ok i get it now
<jackdaniel>
being able to modify a program at runtime is the clue of being interactive; and not all languages feature that - and some of these that do, do it poorly (i.e redefinition semantics are unclear)
<skeemer>
jackdaniel, ohh i see
akoana has joined #commonlisp
<jackdaniel>
great :)
<skeemer>
and there is no scheme that does that ?
<jackdaniel>
that's not what I've said. I've said that scheme standard does not specify such semantics
<jackdaniel>
afaik guile allows that to some extent. regarding how safe is that and whatnot is beyond my knowledge
<jackdaniel>
there is a fine line between being designed to do something and being used to do something
<jackdaniel>
you can drink from a pot, but a cup is better suited for that
OlCe has quit [Ping timeout: 272 seconds]
<Nilby>
Sometimes I consider ragequitting CL to scheme, but I can't handle not having CLOS, loop, format, and even unhygenic macros. I could probably only handle guile since it has GOOPS.
dino_tutter has joined #commonlisp
karlosz has joined #commonlisp
jeffrey has joined #commonlisp
<mfiano>
Hygienic macros are one of many macro systems the various Scheme revisions supports.
<mfiano>
Most schemes feature a FORMAT port, and there is a SRFI for such. Similarly for CLOS
<jackdaniel>
a pot and a cup makes a sound in the distance :)
<jackdaniel>
s/makes/make/
<mfiano>
Yes, you should use the smaller cup instead of the whole damn cl-pot
* mfiano
ducks
<|3b|>
green_: local-time:find-timezone-by-location-name can find a timezone from "America/Toronto" not sure why anyone would ever use those "America/Whatever" names though... extra indirection from code and horrible UI for people
* |3b|
seems to remember local-time having some oddities around DST transitions when given a generic timezone though, so might be easier to just use date anyway
<green_>
|3b|, I'm not really knowledgeable in this area. Wouldn't I have to know when to use EST vs EDT if I just used that as my timezone? I was hoping to provide something like America/Toronto and a date so the system would figure it out.
<|3b|>
"America/Toronto" is just an alias for "Eastern Time"
<|3b|>
for anyone that doesn't live in that specific city, it is an extra "what is the biggest city in my timezone" trivia question, that more or less requires them to know their timezone to start with :p
* Nilby
is just glad leap seconds may soon be only a thing of the past.
<|3b|>
(at least i think that was the criteria for picking the specific cities that work)
mgl has quit [Quit: Client closed]
jonatack has joined #commonlisp
<|3b|>
actually i guess more precisely it seems to be an alias for Canada/Eastern
cage has quit [Quit: rcirc on GNU Emacs 28.2]
McParen has joined #commonlisp
jeosol has joined #commonlisp
Brucio-61 has joined #commonlisp
jan_ has quit []
thuna` has joined #commonlisp
azimut_ has quit [Ping timeout: 240 seconds]
attila_lendvai_ has joined #commonlisp
attila_lendvai has quit [Ping timeout: 245 seconds]
flip214 has quit [Read error: Connection reset by peer]
flip214 has joined #commonlisp
kevingal has joined #commonlisp
dcb has joined #commonlisp
thollief has quit [Quit: Leaving]
Lycurgus has joined #commonlisp
puchacz has quit [Ping timeout: 246 seconds]
kevingal has quit [Ping timeout: 246 seconds]
msavoritias has quit [Remote host closed the connection]
mgl has joined #commonlisp
mgl has quit [Client Quit]
kevingal has joined #commonlisp
shka has quit [Ping timeout: 245 seconds]
McParen has left #commonlisp [#commonlisp]
attila_lendvai_ has quit [Remote host closed the connection]
attila_lendvai_ has joined #commonlisp
Lycurgus has quit [Quit: Exeunt: personae.ai-integration.biz]