<pjb>
dmiles: you have to be careful to write your code to be meaningful in both lisp-1 and lisp-2.
<pjb>
dmiles: also, have a look at Butterfly CL (implemented in Butterfly Scheme), and at pseudo-scheme (implemented in CL), and a few others like that.
<dmiles>
oh good these are very helpfull
Th30n has joined #lisp
<pjb>
dmiles: also, for a practical approach, you could have a look at Common Music version 2.
<beach>
shka: Yes, I know about T. I have read the Orbit paper and some other stuff related to T.
<pjb>
The version 3 uses C++ to implement the applicative scheme, but the version 2 did that with Common Lisp. It implements a small scheme in Common Lisp, and use it to implement the application in scheme.
fikka has joined #lisp
<dmiles>
version 2 sounds great then.. secretly i was worried i would have to rewrite wam-cl to be able to run scheme code (like adding some special whatnot)
<dmiles>
even if i have to add that whatnot to do scheme .. at least i have an inchworm starting from converting a CL verison of Scheme to prolog
jstoddard has quit [Remote host closed the connection]
<beach>
dmiles: In general, Common Lisp and Scheme are sufficiently different that one can not run programs in the other. Only if you use a very small subset of both of them, and if you are very careful how you write those programs will such a thing be possible.
jstoddard has joined #lisp
<dmiles>
(special whatnot = call/cc)
<pjb>
dmiles: if the idea is to generaly mix and match languages in a common environment, you should definitely look at poplog.
<dmiles>
the only thing that scares me away from poplog is it is not on Lisp or Prolog
<pjb>
or work with beach to provide a separate scheme compiler targetting the sicl backend ;-)
<dmiles>
(so its harder for me to understand is all)
<pjb>
Better do that early while it's still time to add features to the backend if needed for scheme.
fikka has quit [Ping timeout: 248 seconds]
<dmiles>
from what i understand is that SICL does everyting right as far as it prevides a lisp that can be implmented with not one specific part that isnt writen in lisp
<pjb>
Yes.
<dmiles>
meaning if you can impl at least these 100 or totallly a differnt 100 trampolines then you can get a full CL
quazimodo has joined #lisp
<dmiles>
what are the actual numbers ? (probably not 100)
shifty has joined #lisp
daniel-s has joined #lisp
jstoddar` has joined #lisp
fikka has joined #lisp
<beach>
dmiles: What do you mean by a "trampoline" in this context?
jstoddard has quit [Remote host closed the connection]
damke has quit [Ping timeout: 240 seconds]
<dmiles>
well trampoline is a littel too little.. what i really meant was at least some kind of REPL that does some lisp (not quite CL) and then by tramplines i mean at least some lisp functionality exists in the impl like #'EQ #'MAKE-VECTOR REPLACD
<dmiles>
some functionally that SICL can at least begin to work with
<beach>
That is not how SICL works though.
<dmiles>
ah.. glad i am asking
<turkja>
pjb: i'm now a bit confused.. to what it looks to me, Common Music 2 is a pure CL application, it just automatically ports some of the Scheme code (translated code looks horrible, but works). Anyways, you write the programs in CL. I'm using it with SBCL.
<dmiles>
i keep getting SICL confused with some other Impl
damke has joined #lisp
<beach>
dmiles: It is a common way of bootstrapping Common Lisp systems, and then the minimal system is written in something other than Common Lisp. I explicitly did not want to do it that way, because then I would have to write large parts of the system in a subset of Common Lisp and that turned out to be too painful.
<pjb>
turkja: I may be wrong. I thought it had basically the same structure as CM3.
jmercouris has joined #lisp
<pjb>
I have the sources around, but I could only gave it a quick look.
<turkja>
It's CL, and it is still used quite a lot actually
<pjb>
ok. Better then!
<dmiles>
beach: so give a small overview of how SICL is written if you dont mind
<pjb>
I'd bet there's a document somewhere.
<beach>
It is written using the full Common Lisp language. To create an executable, it requires that some of the code be executed by a host Common Lisp system.
<dmiles>
yeah or a document
<dmiles>
(to to avoid write large parts of the system in a subset of Common Lisp )
<pjb>
jmercouris: I don't agree that inheritance is evil. IMO a better formulation would be that inheritance is too complex for mosts human brains, it seems.
<beach>
dmiles: For example, the SICL LOOP macro uses standard classes to represent the clauses, so CLOS is required to expand the LOOP macro. And of course, CLOS uses LOOP a lot.
<pjb>
(there are books full of formal semantics of OOPL, so indeed, it may be too complex for most humans).
<jmercouris>
pjb: It's about implementation inheritance in a multiple inheritance scenario
<jmercouris>
pjb: as far as I understand, interface inheritance = good, but implementation = bad, too much unexpected
dddddd has joined #lisp
<dmiles>
beach: ahah not that LOOP<->CLOS relation would happen in the immagined SICL i had
<beach>
Anyway, I'll have lunch guests in a few minutes, so I'll be off for several hours.
<dmiles>
beach: ahah now i see.. that LOOP<->CLOS relation would happen in the immagined SICL i had
<pjb>
Well, in lisp we keep doing that. We call it "punning". Of course, it's done only at a small scale, eg. lists or trees are actually cons cells, so we may use car/cdr on them.
<beach>
dmiles: In SICL, I can also do things like (defclass symbol (t) ((%name ...) (%package ...)) (:metaclass built-in-class))
<pjb>
jmercouris: I'd tend to agree, once you follow strictly the lyskov substitution principle, with good pre/post conditions defined for each of your methods, you cannot randomly use inheritance just for implementation.
<beach>
dmiles: Most Common Lisp implementations must do something special for built-in classes, because most implementations start with a subset that does not contain CLOS.
<jmercouris>
pjb: What is the lyskov substitution principle?
<dmiles>
beach: interesting .. so the intended usecase mostly to create executables?
<pjb>
Generated files cannot be maintained. This is why I started to write a C compiler targetting CL, to be able to run GNU emacs in a CL image.
<turkja>
pjb: originally yes, but it is somehow generated as Lisp, so it can be run on for example SBCL
<pjb>
turkja: Of course.
<dmiles>
(for instance if i couldnt on wam-cl produce executables)
<beach>
dmiles: By "the executable" I mean the SICL system itself, the one that gets executed when you type "sicl" to the shell prompt.
hel-io has quit [Ping timeout: 260 seconds]
shrdlu68 has joined #lisp
<beach>
dmiles: And, no, that is not the intended use case.
<turkja>
CM2 is IMHO still the best algorithmic composition system around :D
<jmercouris>
pjb: Yeah the clone :\
<jmercouris>
says: The server unexpectedly dropped the connection
<dmiles>
beach: but it is for someone implementing lisp to borrow from so they dont need to maintain some copy?
<jmercouris>
pjb: Did you by any chance try my browser?
<dmiles>
beach: some copy of loop.lisp that they copied from XCL lisp
<beach>
dmiles: Sure, it is free. But you can't use it to obtain a full Common Lisp system from a subset of Common Lisp. I have no defined dependency order. There are circular dependencies.
<dmiles>
beach: circular is jsut fine for me.. sinc ei jsut implenet whatever breaks your loop
<pjb>
jmercouris: sorry, I'm short on time currently, so I cannot try stuff.
varjag has joined #lisp
<beach>
dmiles: So, LOOP uses LOOP.
<jmercouris>
pjb: It's okay, if you do try it though, please let me know, I would be very interested in feedback about the usability of it
<beach>
dmiles: Every built-in class, like SYMBOL, PACKAGE, HASH-TABLE requires CLOS.
<beach>
dmiles: Do you intend to implement LOOP to break the dependency of LOOP so that you can use SICL LOOP in your system?
<dmiles>
beach: i ended making a somewhat minimal loop i assume will be redified by XMLs loop.. in our case (SICL and I) I end up not using your loop if it ends up being an issue
<dmiles>
XML/XCLs
<beach>
dmiles: The entire system is like that.
<dmiles>
well if they HASH-TABEL uses CLOS that is easier form me
<dmiles>
if PACKAGE uses CLOS (in fact i wrote my package impl in my sub-clos)
<dmiles>
that might be fine
<jmercouris>
beach: Which time zone are you in?
<beach>
UTC+1
<jmercouris>
beach: I thought you were australian?
varjag has quit [Ping timeout: 248 seconds]
<beach>
I have no idea why you thought that. But I could have been and still live in UTC+1.
<jmercouris>
beach: If you don't mind me asking, where are you from?
<dmiles>
beach still i'll end up using ytour PACKAGE with my Less-Sub-CLOS jsut because my PACKAGE isnt all that brilliant
<beach>
jmercouris: That is a question that is too hard for me to answer, and if I tried, the answer would be misleading. I have lived in 5 countries on 4 continents.
<dmiles>
Less-sub-CLOS (less sub-CLOS than my current CLOS)
<beach>
jmercouris: I am a citizen of the European Union. That much is certain.
<jmercouris>
beach: Let me ask a simpler question, what is your first language?
<turkja>
beach: maybe you appear as australian because of your decent online times :) i'm at UTC+2 and log in usually around the same in the morning
<beach>
jmercouris: The one I master best is English.
<beach>
jmercouris: But that is off topic.
random-nick has joined #lisp
<jmercouris>
Yep, sorry, didn't mean to derail the channel, I was just wondering because of the time discrepancies
* dmiles
typing and grammar is so poor usualyl he is asked in English is his first language
* dmiles
will probably do what ABCL did have sucky versions of lots of CL then let the .lisp libraries create the good versions
<pjb>
jmercouris: furthermore, beach originaly came from a country that doesn't exist anymore, and is living in a country that soon won't exist anymore either.
<pjb>
As for the EU, I won't expand here…
<dmiles>
(ABCL replaces the .java versions of MAKE-PACKAGE and HASH-TABLE with versions coded in lisp)
<pjb>
dmiles: the "replaces" part is only an artefact of the bootstrap process. You could more easily just generate a good lisp image eithout modifying the current one.
<dmiles>
(so ABCL contains as many cycles perhaps as SICL)
Th30n has quit [Ping timeout: 248 seconds]
<dmiles>
pjb: you mean with SICL it actualyl may not need to modify what it loads on?
Th30n has joined #lisp
sukaeto has quit [Quit: WeeChat 1.0.1]
<pjb>
dmiles: I don't know precisely how sicl does it. In general, you can just build the future lisp image separately from the current process. Imagine you wrote it in C++!
<dmiles>
ah yes.. once the lisp is actualyl built on WAM CL.. and the entrie system is transpiled i suppose i never have to go back to my broken versions
<jmercouris>
pjb: How does the serialization process look? just like a memory dump? or does it have to be specialized and written?
<pjb>
jmercouris: it can be anything you want. The principle is to have an internal model of the new lisp image, and to save it to a file in the right format.
<pjb>
Since this file will contain the image loading part, you're free to do it however you want.
<jmercouris>
So the image itself contains information on how to load the image?
<jmercouris>
So you are saying that the implementation of the image saving may change dramatically without the kernel changing? is that the idea?
jmsb has quit [Ping timeout: 240 seconds]
<dmiles>
also i can just "translate" SICL to *.trans.pl files and then go in an fix my translation errors
<dmiles>
(eventually i would hope to not have any .pl files that i wrote myself)
<dmiles>
(this info for jmercouris kind of... and to confirm with pjb if that is also part of what he meant)
hel-io has joined #lisp
<dmiles>
and realizing that beach's circular issue is not a problem if i dont even try to replace anyhting.. just run over everything and see what i can today translate into working
<pjb>
jmercouris: yes.
kjak has joined #lisp
<pjb>
jmercouris: executable images (apart from ecl which doesn't actually generate images, but actual executables) contain code to load the rest of the image in their executable part.
<pjb>
jmercouris: and non executable images contain (usually) code to save an image, including an executable image, therefore they contain the code to load the image!
<dmiles>
it is probly extra work to uninclude the ability to write an image .. though AllegroCL did try for a bit
EvW has joined #lisp
jstoddar` has quit [Remote host closed the connection]
jstoddar` has joined #lisp
<pjb>
It can be a feature requrested by commercial users.
EvW has quit [Ping timeout: 260 seconds]
jstoddar` has quit [Remote host closed the connection]
smurfrobot has joined #lisp
smurfrobot has quit [Ping timeout: 260 seconds]
damke_ has joined #lisp
damke has quit [Ping timeout: 240 seconds]
Ven`` has joined #lisp
DeadTrickster has quit [Read error: Connection reset by peer]
DeadTrickster has joined #lisp
wxie has quit [Quit: Bye.]
nowhere_man has quit [Ping timeout: 248 seconds]
pseudonymous has joined #lisp
Ven`` has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
varjag has joined #lisp
kjeldahl has joined #lisp
scymtym has quit [Ping timeout: 248 seconds]
varjag has quit [Ping timeout: 260 seconds]
Th30n has quit [Ping timeout: 255 seconds]
red-dot has quit [Quit: Going offline, see ya! (www.adiirc.com)]
damke_ has quit [Ping timeout: 240 seconds]
damke has joined #lisp
<flip214>
minion: note for attila_lendvai: Hi, would you care to discuss a small iterate feature request? You're the last committer, I didn't find anybody else caring about it.
<minion>
Remembered. I'll tell attila_lendvai when he/she/it next speaks.
<jmercouris>
pjb: Very interesting, I'm starting to understand non ecl- things a little more
nowhere_man has joined #lisp
motersen has joined #lisp
dddddd has quit [Remote host closed the connection]
Amplituhedron has quit [Ping timeout: 248 seconds]
safe has quit [Quit: Leaving]
damke_ has joined #lisp
scymtym has joined #lisp
jmercouris has quit [Ping timeout: 240 seconds]
damke has quit [Ping timeout: 240 seconds]
SaganMan has joined #lisp
motersen has quit [Quit: rcirc on GNU Emacs 25.3.1]
motersen has joined #lisp
mishoo_ has quit [Ping timeout: 260 seconds]
motersen has quit [Remote host closed the connection]
motersen has joined #lisp
EvW1 has joined #lisp
daniel-s has quit [Ping timeout: 260 seconds]
damke_ has quit [Ping timeout: 240 seconds]
phadthai has quit [Ping timeout: 260 seconds]
margeas has joined #lisp
Jen has joined #lisp
nowhere_man has quit [Ping timeout: 255 seconds]
Jen is now known as Guest89452
damke_ has joined #lisp
EvW1 has quit [Ping timeout: 258 seconds]
SuperJen has quit [Ping timeout: 248 seconds]
wxie has joined #lisp
ryanwatkins has quit [Ping timeout: 240 seconds]
Guest34322 has joined #lisp
wxie has quit [Quit: Bye.]
DeadTrickster has quit [Read error: Connection reset by peer]
DeadTrickster has joined #lisp
random-nick has quit [Remote host closed the connection]
Tobbi has joined #lisp
ryanwatkins has joined #lisp
<beach>
pjb: Thanks for the clarification! :)
random-nick has joined #lisp
bkst has joined #lisp
ryanwatk` has joined #lisp
resttime has left #lisp ["Leaving"]
quazimodo has quit [Ping timeout: 248 seconds]
<Xach>
borodust: just tried with latest dist, no luck :(
Guest89452 has quit [Remote host closed the connection]
Guest89452 has joined #lisp
hel-io has quit [Ping timeout: 260 seconds]
Bike has joined #lisp
SuperJen has joined #lisp
Th30n has joined #lisp
Guest89452 has quit [Ping timeout: 260 seconds]
red-dot has joined #lisp
shrdlu68 has quit [Ping timeout: 260 seconds]
damke has joined #lisp
nika has joined #lisp
basket has quit [Ping timeout: 268 seconds]
damke_ has quit [Ping timeout: 240 seconds]
BitPuffin|osx has quit [Ping timeout: 260 seconds]
EvW has joined #lisp
damke_ has joined #lisp
<phoe>
I have a list (:a :b :c :d :e :f). There was a function that found an element in the list in a way that it returned the list's nthcdr containing that element, like, (foo :d list) ;=> (:d :e :f). What was that function?
<shka>
nice to see that i am not the only one that finds some parts of CL obscure
ym has quit [Quit: Leaving]
<Xach>
that's one of those functions i want to use but can't find the situation often enough
<shka>
heh, this makes me want to make new project named that-one-project-that-uses-get-properties :D
orivej has quit [Ping timeout: 268 seconds]
ryanwatk` has quit [Remote host closed the connection]
ryanwatk` has joined #lisp
phadthai has joined #lisp
EvW has quit [Ping timeout: 240 seconds]
smurfrobot has joined #lisp
pseudonymous has quit [Ping timeout: 255 seconds]
mishoo_ has joined #lisp
shrdlu68 has joined #lisp
Amplituhedron has joined #lisp
<borodust>
Xach: ;(
hel-io has quit [Ping timeout: 260 seconds]
<borodust>
hmm, alright, lets see what else that could be
<borodust>
too bad it mostly works on macos D:
hel-io has joined #lisp
* dmiles
has i use properties sybols when i dont want to use a separate hastable
LiamH has joined #lisp
<dmiles>
separate hashtable to remember something about the symbol
smurfrobot has quit [Remote host closed the connection]
<dmiles>
for instance if i am printing out information about sometings in a list and that list might repeat.. the way i remember that i prointed the items is to put a property on that time
<dmiles>
rather than a hashtable that remembers i printed some item
DeadTrickster has quit [Read error: Connection reset by peer]
<dmiles>
worst way ever to use them i know
DeadTrickster has joined #lisp
k-stz has joined #lisp
knobo2 has quit [Ping timeout: 240 seconds]
knobo2 has joined #lisp
trouble has joined #lisp
hel-io has quit [Remote host closed the connection]
dieggsy has joined #lisp
mercipher has joined #lisp
hel-io has joined #lisp
smurfrobot has joined #lisp
smurfrobot has quit [Remote host closed the connection]
trouble has quit [Quit: ERC (IRC client for Emacs 25.3.1)]
knobo2 has quit [Ping timeout: 260 seconds]
dieggsy has quit [Remote host closed the connection]
hel-io has quit []
knobo2 has joined #lisp
DeadTrickster has quit [Read error: Connection reset by peer]
DeadTrickster has joined #lisp
smurfrobot has joined #lisp
Amplituhedron has quit [Ping timeout: 268 seconds]
pseudonymous has joined #lisp
<borodust>
Xach: btw, does window with "Scene" title appear before crashing int debugger?
orivej has joined #lisp
SuperJen has quit [Remote host closed the connection]
SuperJen has joined #lisp
shenghi has quit [Remote host closed the connection]
shenghi has joined #lisp
smurfrobot has quit [Remote host closed the connection]
motersen has quit [Ping timeout: 240 seconds]
shka has quit [Quit: Konversation terminated!]
easye has joined #lisp
smurfrobot has joined #lisp
smurfrobot has quit [Remote host closed the connection]
smurfrobot has joined #lisp
EvW has joined #lisp
eSVG has quit [Ping timeout: 240 seconds]
EvW has quit [Ping timeout: 276 seconds]
papachan has joined #lisp
asarch has joined #lisp
smurfrobot has quit [Remote host closed the connection]
bluerama has joined #lisp
basket has joined #lisp
Th30n has quit [Ping timeout: 255 seconds]
k-stz has quit [Remote host closed the connection]
<kuwze>
okay I am trying to figure out thus bug. first of all, it only happens sometimes when I compile the whole project (ql:quickload "cl-oanda"). the bug/error goes away when I quit slime and restart it.
<kuwze>
I am using Clozure Common Lisp Version 1.11-r16635 (LinuxX8664)
<Shinmera>
dlowe: Apparently you sent me a note about Portacle debug settings a long time ago that I never got because plexi isn't in this channel?
<Shinmera>
dlowe: The answer is that it used to use restrict-compiler-policy to force debug to 3 at one point, until I discovered that certain systems like cl-opengl perform very poorly with that.
damke has joined #lisp
<beach>
kuwze: "typex" and "orderBook" are never going to be EQL.
saemcro has joined #lisp
<kuwze>
beach: thank you for pointing that out.
<beach>
kuwze: And RESULT is not a hash table, it's a list.
damke__ has quit [Ping timeout: 240 seconds]
<beach>
kuwze: Why is this a macro?
mnoonan has joined #lisp
<beach>
kuwze: Why are you implementing make-book as a macro rather than as a function?
clas_ has joined #lisp
<kuwze>
beach: I guess I was trying to practice with macros; I am not sure what I was thinking at the time
<kuwze>
also what does this mean?: Process inferior-lisp segmentation fault (core dumped)
<beach>
kuwze: You can practice macros if you like, but then do it with something that requires a macro. I don't think make-book does.
osune has joined #lisp
eschulte has joined #lisp
<beach>
That means either of several things: 1. Your Common Lisp implementation is buggy. 2. You are doing something that the Common Lisp HyperSpec says has "undefined consequences" and your Common Lisp implementation is taking advantage of that, or 3. You are using buggy foreign code.
<kuwze>
beach: no, I don't want to add aritificial complexity. I'll change it to a function.
pseudonymous has joined #lisp
<kuwze>
beach, in regards to the segfault: I am not using ffi, and I am using the mature CCL, so I guess it must be 2
<beach>
Possibly. Though CCL should not take advantage of those situations very much.
<beach>
kuwze: Oh, and given your level of knowledge of Common Lisp, I think Cluffer is probably too complicated at this point. But I didn't know that when I recommended it. Sorry.
Tobbi has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
papachan has quit [Quit: WeeChat 2.0]
smurfrobot has joined #lisp
<kuwze>
I'm sorry, but what's the newbite channel for common lisp? I don't want to bog down this channel
<kuwze>
newbie*
<beach>
#clnoobs, but I don't know how reactive it is.
<devon>
(fboundp '(setf car)) => NIL(fdefinition '(setf car)) and (function '(setf car)) both err undefined-function; No simple way to detect setf-able names?
<beach>
Use FBOUNDP is you did.
smurfrobot has quit [Ping timeout: 255 seconds]
<basket>
Devon: (fboundp '(setf car)) should return t
<devon>
(fboundp '(setf car)) incorrectly returns NIL in CCL.
<beach>
basket: Why?
dddddd_ has joined #lisp
dddddd has quit [Ping timeout: 268 seconds]
<basket>
beach: Should it not?
<devon>
CLHS 5.1.2.9 Other Compound Forms as Places
Tobbi has joined #lisp
<devon>
A function named (setf f) must return its first argument as its only value in order to preserve the semantics of setf.
<beach>
I can't find it now, but I think there is a general rule that when the Common Lisp HyperSpec says it's an "accessor", then it can be implemented either as a function or as a setf expander.
philozz has joined #lisp
<devon>
CLHS says in several places that (setf f), i.e., (setf car), is a function name.
<devon>
i.e./e.g.
<Shinmera>
It's a function name, but that doesn't mean that an accessor needs to be a function
<Shinmera>
There is a section that specifies that an implementation is allowed to implement (setf foo) as a setf-expander on foo rather than a function.
<devon>
Nobody ever said (setf car) was an accessor.
<beach>
Devon: function name doesn't mean that it is bound to a function.
FreeBirdLjj has quit [Remote host closed the connection]
<Shinmera>
beach: I'm looking
<basket>
It seems (fboundp '(setf car)) is nil on Allegro, LW, Clisp, and CCL, and T on SBCL
<beach>
basket: And that is perfectly valid.
<basket>
Right
<devon>
The symbol CAR and the list (SETF CAR) are both function names. (fboundp 'car) works, if (fboundp '(setf car)) is not required to work, what does?
<Shinmera>
For each standardized accessor function F, unless it is explicitly documented otherwise, it is implementation-dependent whether the ability to use an F form as a setf place is implemented by a setf expander or a setf function. Also, it follows from this that it is implementation-dependent whether the name (setf F) is fbound.
<Bike>
the fact that you can (setf (car ...) ...) doesn't mean there's a function called (setf car). the setf working can also be accomplished by a setf expansion (into eg rplaca and returning the value)
<devon>
Shinmera: Thanks for finding that. The question of how to detect whether a given symbol is setf-able or not remains unanswered.
<Bike>
i don't think you can.
<pjb>
And even if (setf f) is bound, it's still implementation-dependent whether it's used by setf!
<devon>
Lol
<Bike>
get-setf-expansion will return a default sometimes, and if it returns the default you can check whether (setf f) is bound
<Bike>
but i don't know if that's reliable, maybe an implementation could return a non-default setf expansion that still doesn't work
<pjb>
Bike: I wouldn't be so sure. I'd rather use (macroexpand-1 '(setf (f x) v)) to check whether there's a (setf f) function…
<beach>
Shinmera: Thanks!
Tobbi has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Tobbi has joined #lisp
SaganMan has quit [Quit: WeeChat 1.6]
<devon>
(second (fourth (multiple-value-list (get-setf-expansion '(#:foo #:bar))))) => #'(SETF #:FOO) in CCL but it smells unportable
<Bike>
Why do you want to do this?
<Bike>
there can also be situations like, you have a file with (defun (setf foo) ...), and also (setf (foo ...) ...) forms in the file. while compiling the file there is no setf function (and no custom setf expansion), but it'll be fine when it's loaded
<devon>
To require defsetf file-position
<Bike>
you're not allowed to define a setf for file-position, it's a CL symbol.
<devon>
Right, if the expansion looks like #'(setf ##) then there is no expander.
<pjb>
ecl returns (RPLACA #:G143 #:G144), all the others a gensym.
aindilis has joined #lisp
<Bike>
like, (defsetf file-position ...) is verboten.
<devon>
(defsetf file-position file-position) => FILE-POSITION ; So CCL does it and implementations have so much latitude in this, it'd be truly bizarre to forbid it.
scymtym has quit [Ping timeout: 255 seconds]
<Bike>
it's okay for an implementation to do it, but you can't.
<Bike>
clhs 11.1.2.1.2 and all.
<devon>
11.1.2.1.2 Constraints on the COMMON-LISP Package for Conforming Programs ... undefined ... 13. Defining a setf expander for it (via defsetf or define-setf-method).
<devon>
bummer
nowhere_man has joined #lisp
<Bike>
you'll just have to settle for calling file position with the new value yourself.
malice has joined #lisp
<devon>
(incf (file-position s) i) ; no such luck
FreeBirdLjj has joined #lisp
<Bike>
maybe the reason it doesn't have a setf is that it doesn't return the new value like setf is supposed to.
<Bike>
instead it returns a success value (which is also kind of weird)
wooden has quit [Ping timeout: 260 seconds]
<devon>
Lack of (setf file-position) is ugly, implementors should support it.
brendyn has quit [Ping timeout: 248 seconds]
<Bike>
but then you can't determine whether it actually changed or not.
<devon>
Hmm, that breaks the only-fetch-once guarantee.
FreeBird_ has joined #lisp
FreeBirdLjj has quit [Read error: Connection reset by peer]
DeadTrickster has quit [Read error: Connection reset by peer]
DeadTrickster has joined #lisp
<devon>
Thanks everyone, (incf (file-position s) i) will have to wait for the next *ahem* ANSI committee.
LiamH has quit [Read error: Connection reset by peer]
LiamH has joined #lisp
mparashar has joined #lisp
scymtym has joined #lisp
mathrick has joined #lisp
dddddd_ is now known as dddddd
osune has quit [Remote host closed the connection]
<pjb>
Devon: notice however that it should work on implementations running on POSIX systems, and assuming the stream is a binary stream or uses a 1-1 encoding.
<pjb>
I mean, (file-position s (1+ (file-position s)))
Elronnd has quit [Ping timeout: 276 seconds]
Tobbi has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]