Denommus has quit [Read error: Connection reset by peer]
Oladon has joined #lisp
Oladon1 has quit [Ping timeout: 258 seconds]
oni-on-ion has quit [Remote host closed the connection]
oni-on-ion has joined #lisp
fortitude_ has joined #lisp
t58 has quit [Ping timeout: 246 seconds]
FennecCode has joined #lisp
karswell has quit [Ping timeout: 245 seconds]
semz has quit [Ping timeout: 264 seconds]
sonologico has quit [Ping timeout: 272 seconds]
ebrasca has quit [Remote host closed the connection]
semz has joined #lisp
semz has quit [Changing host]
semz has joined #lisp
iarebatman1 has joined #lisp
saravia has quit [Remote host closed the connection]
sonologico has joined #lisp
NickBusey has joined #lisp
krwq has joined #lisp
xkapastel has quit [Quit: Connection closed for inactivity]
Guest93032 is now known as karstensrage
karstensrage has quit [Changing host]
karstensrage has joined #lisp
ltriant has quit [Ping timeout: 244 seconds]
faheem has quit [Remote host closed the connection]
faheem has joined #lisp
lalilulelo has joined #lisp
X-Scale has quit [Ping timeout: 272 seconds]
makomo has quit [Ping timeout: 245 seconds]
Jeanne-Kamikaze has joined #lisp
ltriant has joined #lisp
ltriant has quit [Ping timeout: 272 seconds]
X-Scale has joined #lisp
_whitelogger has joined #lisp
ltriant has joined #lisp
ltriant has quit [Ping timeout: 245 seconds]
pierpal has quit [Quit: Poof]
pierpal has joined #lisp
noobineer has joined #lisp
ltriant has joined #lisp
torbo has joined #lisp
lavaflow has joined #lisp
dddddd has quit [Remote host closed the connection]
iarebatman1 has quit [Ping timeout: 272 seconds]
gravicappa has joined #lisp
aeth has quit [Ping timeout: 245 seconds]
aeth has joined #lisp
Involuntary has joined #lisp
GuerrillaMonkey has joined #lisp
Jeanne-Kamikaze has quit [Ping timeout: 268 seconds]
Involuntary has quit [Ping timeout: 245 seconds]
GuerrillaMonkey has quit [Quit: Leaving]
torbo has quit [Remote host closed the connection]
karlosz_ has joined #lisp
<beach>
Good morning everyone!
lavaflow has quit [Ping timeout: 268 seconds]
DGASAU has quit [Read error: Connection reset by peer]
anewuser has joined #lisp
Bike has quit [Quit: Lost terminal]
lavaflow has joined #lisp
<beach>
I can just see it. Some users voting for features that would totally destroy the nice properties of Common Lisp, and not knowing the consequences. Like making EVAL take into account lexical bindings and other stuff like that.
pierpal has quit [Ping timeout: 245 seconds]
vlatkoB has joined #lisp
<beach>
I also think that people have very strange ideas about standards, and about standardization.
sonologico has quit [Remote host closed the connection]
fortitude_ has quit [Ping timeout: 248 seconds]
<no-defun-allowed>
One of the things I've heard from one specific /r/lisp troll is that standards encourage lowest-common-denominator thinking to implementation features.
<beach>
I don't know about the "encourage" thing. But that is certainly what a standard should be.
<beach>
... or else it would be acceptable to very few.
<no-defun-allowed>
But if you use implementation-specific stuff, are you writing CL/Python/sh/C code or are you writing SBCL/CPython/bash/GCC code? And what about versions if some internal magic changes? Then it's SBCL 1.5, Python 3.7, etc code. Guess he's a good troll if I'm thinking about it.
<beach>
So one of the misconceptions is that you can only use things that are in the standard, speaking of what you just said.
<beach>
I was talking about libraries, not about implementation-specific stuff.
<beach>
Some people with this misconception then happily go out and use entire programming systems that are based on no standard whatsoever.
dale has quit [Quit: My computer has gone to sleep]
<beach>
Another misconception has to do with what a standard *is*. It is a document published by an *independent* organization. And that document must have an ISBN or some other identifier that uniquely defines the document. The document can then not be changed in any way.
<beach>
So a definition of a language published by the same people who provide an implementation does not count as a standard.
DGASAU has joined #lisp
<beach>
Many of the people here who want more features in Common Lisp would like for the language definition to be more like that of some non-standardized languages, in that it is updated more often. But, since those other languages do not have any standard, the people who want more features are completely free to go define a new version of Common Lisp with those features.
<beach>
Their language definition will be neither more nor less worth than that of Python, for instance. Neither is a standard.
<aeth>
beach: I don't think C++ has many fans here, but one thing it does is release new versions of its standard every 3 years, since 2011. That is probably the limit of the speed of a standard, once every 3 years. (Of course, it can take longer for the features to reach implementations.)
<aeth>
heh, ECMAScript is annual
<aeth>
I don't think annual would work with a language like CL
<beach>
But C++ is a language without a reasonable macro system and with very complicated syntax. So any new feature requires a new definition of the language itself. We don't have this problem, so we should not behave as if we do.
<aeth>
Yes, I agree.
<no-defun-allowed>
Absolutely.
flamebeard has joined #lisp
<aeth>
A hypothetical newer CL standard would imo have to be mainly about exposing primitives for building higher level constructs through macros. Stuff like making threads standard. Not stuff that can be implemented easily in macros.
<beach>
But, as far as I can tell, all implementations agree on how threads work, and we even have Bordeaux-threads to unify them. So why do we need an update of the language definition?
<beach>
Do other language standards mention threads?
<beach>
or rather, what other language standards mention threads, and what do they say about them?
<aeth>
Imo, threads would be the least controversial thing to add, not the reason for doing a standard.
<beach>
What?
<aeth>
There are some rarer things like package local nicknames, extensible sequences, extensible streams, etc.
<beach>
Again, why do you want this to be in a standard?
<beach>
Is it worth the effort of a new standard, just to stick in stuff that all implementation already agree upon?
<TMA>
If Java is considered standardized, threads are part of that standard.
<aeth>
beach: Well, on the topic of threads, bordeaux-threads is sort of the intersection of common threading features, afaik. It doesn't cover everything that e.g. sb-thread can do
<beach>
TMA: Java is not standardized.
<beach>
Absolutely not.
<aeth>
A standard could be an opportunity to expose more features.
libertyprime has joined #lisp
<beach>
aeth: That does not require a standard. Just a definition.
shka_ has joined #lisp
<aeth>
beach: A standard wouldn't be required for many things if there was something like Scheme's SRFI that was widely accepted. I think CL had a "CDR" system but it was mostly or entirely ignored and I think the website went down at some point.
<aeth>
And in fact, new standards in Scheme mostly just adopt some really popular SRFIs
<aeth>
(afaik)
<beach>
Again, a standard is a very different thing from CDRs and SRFIs.
<aeth>
CL has a larger base language making there less of a need for SRFIs, but that also means that there isn't a popular mechanism to handle extensions in a more formal way than portability libraries.
<aeth>
s/need for SRFIs/need for things like SRFIs/
<beach>
But I should shut up. This discussion upsets me, and I am obviously not expressing myself very well.
<beach>
There is so much important activity we need. And how do we spend our time? Yearning for being more similar to Python.
<aeth>
Yes, that's not a standard. I personally think that anyone really interested in a "new standard" should instead try to revive/replace CDRs, though. That probably gives 90% of what "new standard" proponents want, anyway.
libertyprime has quit [Quit: leaving]
ltriant has quit [Quit: leaving]
libertyprime has joined #lisp
milanj has quit [Quit: This computer has gone to sleep]
<aeth>
I agree about important activity, though. On the list of priorities, I'd put that sort of thing very low. There are some critical incomplete/missing libraries, especially related to GUIs.
JohnMS_WORK has joined #lisp
<beach>
And revising the standard would fix that?
<aeth>
No, it actually goes the other way around. If there was a thriving ecosystem of applications, then a new standard would probably eventually (possibly 10+ years later) come up from all of the added activity and attention, and with all of the exposed corner cases.
<Godel[m]>
Hello, is there a destructuring-bind for special variables?
<aeth>
I think the main risk with the approach I suggested is if everyone just settles on one implementation to write new libraries and applications.
<beach>
Godel[m]: How would it work?
kajo has joined #lisp
<LdBeth>
Good afternoon
<beach>
Hello LdBeth.
FennecCode has quit [Quit: ERC (IRC client for Emacs 26.2)]
<Godel[m]>
(destructure-special (a b c d) '(1 2 3 4)) should use defvar or defparameter to create special variables a b c d
<aeth>
Godel[m]: Do you mean like this? (destructuring-bind (*foo*) (list 1) (declare (special *foo*)) *foo*)
<beach>
Godel[m]: No, it does not exist. You need to wait for a new revision of the Common Lisp standard for that to work.
frgo has joined #lisp
<ober>
or port the awesomeness of lexical scoping from elisp :P
<LdBeth>
I find it’s more valuable to have formal semantics rather than bring facilities to language
<Godel[m]>
aeth: Yeah, but I don't want to have to declare them special myself...
<Godel[m]>
Actually, I want them to be global.
<LdBeth>
Göd.el: try prog
<aeth>
Godel[m]: if you don't care about the global step, you can easily write a macro that inserts declarations... the global stuff, that can afaik be done but is harder
<beach>
Look, the features we collectively agree are acceptable to use are determined by complex social activities, of which the publication of a standard, a CDR, or a SRFI are just a few. Others have to do with the quality of the implementation and the documentation of the feature in question, and even with the behavior of the people who proposed the feature and its implementation.
<beach>
Publishing a standard is no guarantee that all the features in it will be collectively acceptable (logical pathnames are one example), and on the other hand, features can be collectively acceptable without being in a standard (Common Lisp threads is an example from Common Lisp, but languages like Java are even better examples).
<beach>
The people who suggest revisions to the Common Lisp standard seem to think that there is some magic with a standard that will automatically make its contents collectively acceptable. That is not the case. In fact, it is usually the other way around. Standards are established only when some feature has shown to be collectively acceptable.
<beach>
But since people happily use entire programming systems without any standard behind them, I think the fact that we already have a good standard, and several libraries that define collectively acceptable features, is already very good. Our time is better spent on libraries or applications.
<aeth>
Godel[m]: Actually, you don't need declarations if you have the global, so it's either/or
<aeth>
beach: Imo you should probably put that in a hyperlinkable location like an FAQ of sorts. It comes up enough.
<beach>
I probably should, but it makes me tired just to think about it.
<TMA>
beach: Well said.
varjagg has joined #lisp
<aeth>
Godel[m]: If you're willing to have an outer, top-level macro and an inner macro, I think it would be very doable. The outer macro would just expand into `(progn ,@the-defparameters-or-defvars ,@body) where you'd build up the globals from an inner macro... if macros are allowed to communicate.
<aeth>
otherwise, you'd have to code-walk
<aeth>
I'm not sure because I've never written anything this... strange.
<Godel[m]>
Thanks. Let me see if I can make that work.
<aeth>
so e.g. (with-possible-globals (defun foo (l) (destructuring-specials (*a* *b* *c*) l ...)))
shka_ has quit [Ping timeout: 245 seconds]
lavaflow has quit [Read error: Connection reset by peer]
lavaflow has joined #lisp
varjagg has quit [Ping timeout: 248 seconds]
krid has quit [Ping timeout: 246 seconds]
oni-on-ion has quit [Remote host closed the connection]
oni-on-ion has joined #lisp
ACE_Recliner has quit [Read error: Connection reset by peer]
<beach>
So, rather than a revised standard, here is what I personally think has higher priority (in no particular order):
<beach>
1. A good FFI-free GUI library. McCLIM is now already very very good, but it could use some more features to make it more acceptable to people who are used to simpler (but perhaps better-looking) GUI libraries from other languages. And it needs documentation that is adapted to people who are used to the way these other libraries are organized.
<beach>
2. A better development environment (editor, debugger, inspector). A better editor has to do more extensive analysis of the buffer contents at typing speed, and that requires a compiler (or the first few passes of one) that is fast and incremental. A better debugger would execute in a thread and make it possible to set thread-specific breakpoints in an application thread. As far as inspectors go, scymtym has recently completed a
<beach>
McCLIM-based inspector that is much better than what we currently have.
<beach>
3. Libraries that will decrease the collective maintenance burden on implementers of Common Lisp systems. For example, a library that can define the syntax (and other features) of every special form and every standard macro. But there are many more examples that I won't go into.
<beach>
All these things (and more) are being worked on, but we could always use more help. Unfortunately, most of these things require expertise in at least one domain (graphics rendering, algorithms and data structures, compilation, etc.) so people would have to start reading up on these things. Also, some things, like the debugger, require support from the implementation, which makes them even harder to accomplish.
<beach>
Now the purpose of these priorities of mine is not mainly to make Common Lisp more attractive to people who are currently not using Common Lisp, but to make the people already using Common Lisp more productive, so that more applications and libraries can be produced with less effort.
libertyprime has quit [Ping timeout: 272 seconds]
<ober>
wow
<beach>
I am convinced that more high-quality applications are required to make Common Lisp more attractive, but that is neither a main objective of mine, nor guaranteed to happen as a result of more applications.
<ober>
a stuffed bird forced to fly
<beach>
Er, what?
<beach>
Could you elaborate on the meaning of that remark?
SaganMan has joined #lisp
<ober>
the lack of movement wrt clhs
<ober>
vs the motion in all the other languages.
<ober>
seems like a hard sell
<beach>
So I take it that none of my explanations made any sense. *sigh* Another reason to shut up.
<LdBeth>
GG
<ober>
no I'm hooked. just seeing the velocity of the other languages
<beach>
Which is a very bad thing.
<ober>
the fashionalble ones
<ober>
I'm on the same page, and page size
<beach>
And I think we should abandon the idea of "selling" Common Lisp, especially for the wrong reasons.
<ober>
just in my experience the valley is all about redoing something poorly in something new to make a name for oneself
<beach>
Why do you care about what others do?
<jackdaniel>
I saw recently a graph (based on github apis) and Common Lisp activity is on a rise for a few years
<jackdaniel>
let me find where did I find it
<ober>
because as a programmer one never has the lack of other people on the team who have to support anything you write, or push.
<ober>
it's an odd mentality to have in the name of supportability no?
<jackdaniel>
fiddlerwoaroof posted it on twitter (and luis retooted it ;-)
<ober>
oh and paychecks sort of depend on some collaboration
pierpal has joined #lisp
<jackdaniel>
ober: what is your claim? I think I'm lost
<beach>
Me too.
<ober>
"to make common lisp attractive"
<ober>
to whom?
<beach>
"We need to revise the Common Lisp standard annually, so that ober can keep the current employment and collaborate with the other team members"
<ober>
no, you're on the wrong path there. that was merely a reply to your question on "why do you care about others?"
<beach>
I see.
<jackdaniel>
as far as I understand what beach said, the "whom" part is to the existing CL programmers. as of making it attractive to the "outsiders", there is some very good material on the web
<jackdaniel>
most notably paip and pcl
<jackdaniel>
I don't think that changing the language will buy anyone anything
<beach>
Exactly.
<jackdaniel>
naysayers will still label it LISP (as '60 programming language) while people who already use it will have broken code
<ober>
well if it's just the existing lispers, cool.
<jackdaniel>
I think you are a very selective reader
<beach>
And, after having studied the psychological forces involved in what tools people use and for what reason, I have absolutely no idea how to convince anyone to use Common Lisp who doesn't want to. Certainly, revising the standard does not address any of those forces.
<ober>
yeah I disabled the reader
<jackdaniel>
like some of the written words were missing
pierpal has quit [Ping timeout: 246 seconds]
<jackdaniel>
I know as a fact that aggressive evangelisation and saying: what you use is crap, use CL -- it has the opposite effect than intended
<beach>
My experience in the past is that the only thing that *might* work (but there is no guarantee) is to avoid any attempt at convincing entirely, and to just show that good work can be accomplished with good productivity.
<jackdaniel>
not to mention cl is in some ways crap like any language, it is not a silver bullet
<beach>
jackdaniel: Absolutely!
<ober>
why go to that extreme? nothing was implied to that nature
<jackdaniel>
ober: I'm referring to a practice of some lisp folks which was observed in a nature
<ober>
getting new blood to collaborate on new or existing projects in CL is a great idea.
<ober>
I'm outside that cluster :P
<jackdaniel>
which resulted in mutliple backlashes of frustrated people who failed to learn and use CL (or got offended)
<jackdaniel>
beach: I know that your "absolutely" was referring to the aggressive evangelisation futile efforts, but I find it funny to see it directly below "cl is crap" ;-)
<beach>
As it turns out, I partly agree. Not about the language, but about our development environment.
<jackdaniel>
heh
<LdBeth>
Is it still considered good to use symbol properties?
<jackdaniel>
do you have a reason to believe it is bad?
<beach>
I don't see this feature used very often, but I see no reason against it.
<ck_>
I was thinking about putting up a picture frame, but then I remembered that my hammer technology has not been revised in decades. So I can't bring myself to use it, how can I justify it? There's amazing advances in laser cutting and so on. "Hammer" is just never updated.
<jackdaniel>
label it "retro" and sell for 10x the price
<LdBeth>
It’s an old system written in the fashion of CLtL1, arbitrary symbols interned could be put properties on them, which prevents the use of package to modulize
<JohnMS_WORK>
Retro and Rustic!
<ck_>
There you go, that's the solution for the lisp discussion as well, then. Retro Artisinal List Processing.
<LdBeth>
*module them
<jackdaniel>
LdBeth: if they do not fit your needs then don't use them
<aeth>
ck_: You can have a digital picture frame with a Raspberry Pi.
<aeth>
Well, you probably can, I don't see why you can't
<aeth>
Make sure to use the Pi 4, it's the newest.
<jackdaniel>
I don't think it will play nice with hammer ;)
<jackdaniel>
as amusing as this chit chat is, time to get some work done, see you later \o
<ck_>
Hammer wins every time.
<ck_>
bye :)
<aeth>
bye
ggole has joined #lisp
<LdBeth>
Bye
<LdBeth>
I find the concept of using symbol property list shown in CLHS very close to aspect oriented programming
<shka__>
luckly, you also have :before and :after methods
<shka__>
so you don't have to
<ck_>
LdBeth: all these fancy methodologies I have pretty much only ever seen in academic programs
<LdBeth>
In aspect oriented programming slots of objects can be created on the fly without prior declaration
<jackdaniel>
aspect oriented programming is very similar to adding mixins to achieve some specific behavior
<jackdaniel>
and stealth-mixins allow aspect-injection ;)
<jackdaniel>
(used with auxiliary methods that is)
gigetoo has quit [Ping timeout: 245 seconds]
<LdBeth>
there’s also create an object without prior decl of class, called prototype
kajo has quit [Ping timeout: 276 seconds]
manualcrank has quit [Quit: WeeChat 1.9.1]
krwq has quit [Remote host closed the connection]
pierpal has joined #lisp
oldtopman has quit [Ping timeout: 272 seconds]
cosimone has joined #lisp
karlosz_ has quit [Quit: karlosz_]
gigetoo has joined #lisp
oldtopman has joined #lisp
Lord_of_Life has quit [Ping timeout: 244 seconds]
Lord_of_Life has joined #lisp
irdr has quit [Remote host closed the connection]
milanj has joined #lisp
cosimone has quit [Quit: WeeChat 2.4]
cosimone has joined #lisp
techquila has joined #lisp
mindthelion has quit [Ping timeout: 244 seconds]
karlosz has quit [Remote host closed the connection]
karlosz has joined #lisp
cosimone has quit [Quit: WeeChat 2.4]
ebrasca has joined #lisp
heisig has joined #lisp
gxt has joined #lisp
libertyprime has joined #lisp
amerlyq has joined #lisp
lalitmee has joined #lisp
kajo has joined #lisp
m00natic has joined #lisp
igemnace has quit [Ping timeout: 246 seconds]
_whitelogger has joined #lisp
gxt has quit [Ping timeout: 260 seconds]
cosimone has joined #lisp
orivej has joined #lisp
Mandus has quit [Ping timeout: 268 seconds]
Mandus has joined #lisp
lalilulelo has quit [Read error: Connection reset by peer]
kajo has quit [Remote host closed the connection]
kajo has joined #lisp
frgo_ has joined #lisp
frgo has quit [Ping timeout: 248 seconds]
frgo_ has quit [Ping timeout: 258 seconds]
SaganMan has quit [Ping timeout: 268 seconds]
random-nick has joined #lisp
zotan has quit [Ping timeout: 276 seconds]
zotan has joined #lisp
alter-schjetne has joined #lisp
schjetne has quit [Ping timeout: 244 seconds]
jdz has quit [Ping timeout: 246 seconds]
alter-schjetne has quit [Ping timeout: 248 seconds]
SaganMan has joined #lisp
jdz has joined #lisp
makomo has joined #lisp
cosimone has quit [Quit: WeeChat 2.4]
techquila has quit [Ping timeout: 248 seconds]
vaporatorius has joined #lisp
vaporatorius has quit [Changing host]
vaporatorius has joined #lisp
cosimone has joined #lisp
orivej has quit [Ping timeout: 248 seconds]
dddddd has joined #lisp
anewuser has quit [Quit: anewuser]
Ricchi has quit [Remote host closed the connection]
_jrjsmrtn has quit [Ping timeout: 245 seconds]
__jrjsmrtn__ has joined #lisp
SaganMan has quit [Ping timeout: 246 seconds]
flamebeard has quit []
orivej has joined #lisp
frgo has joined #lisp
orivej has quit [Ping timeout: 272 seconds]
Nomenclatura has quit [Quit: q]
cosimone has quit [Quit: WeeChat 2.4]
SaganMan has joined #lisp
oni-on-ion has quit [Remote host closed the connection]
oni-on-ion has joined #lisp
LiamH has joined #lisp
lalitmee has quit [Ping timeout: 244 seconds]
SaganMan has quit [Ping timeout: 268 seconds]
lavaflow has quit [Ping timeout: 246 seconds]
lavaflow has joined #lisp
lucasb has joined #lisp
oldtopman has quit [Quit: *pouf*]
Bike has joined #lisp
jil has joined #lisp
<jil>
hello
libertyprime has quit [Quit: leaving]
<jackdaniel>
hey
_nir_ has joined #lisp
<jil>
I'm lost when it comes to quotes, I rarely use lisp and after a few months or years I forget what I read in the doc. Today, it has taken me already some times (~ an hour) to revisite my note to find how to pop a string from a list. I'm using emacs lisp and tried (position "foo" '("foo" 1 2)) to unsucessfuly get the position while (position 'a '(1 2 a)) will rock. What is it that I can keep in mind to make tha work ?
<flip214>
jil: EQ vs. EQL vs. EQUAL vs. EQUALP vs. STRING= etc.
<flip214>
POSITION by default uses EQL, but you need EQUAL or STRING= here.
<beach>
jil: This channel is dedicated to Common Lisp, so you may not get the right answers.
<flip214>
what other programming languages do you use? Perhaps we can find a connect.
<jil>
tody Python on a daily basis but I use to be not so bad in lisp like 20 years ago.
<beach>
jil: In Common Lisp, you pass a keyword argument :TEST to POSITION if you want a test other than the default one.
<pjb>
jil: select Plain Code instead of Plain Text to keep the indentation.
rippa has joined #lisp
longshi has quit [Ping timeout: 268 seconds]
mindCrime has joined #lisp
schjetne has quit [Ping timeout: 258 seconds]
cosimone has quit [Quit: WeeChat 2.4]
nanoz has quit [Ping timeout: 258 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
t58 has joined #lisp
schjetne has joined #lisp
orivej has quit [Ping timeout: 246 seconds]
manualcrank has joined #lisp
ggole has quit [Quit: Leaving]
iarebatman1 has quit [Remote host closed the connection]
m00natic has quit [Remote host closed the connection]
Urfin has left #lisp ["ERC (IRC client for Emacs 27.0.50)"]
karlosz_ has joined #lisp
gareppa has joined #lisp
Bike has quit [Ping timeout: 260 seconds]
gxt has quit [Ping timeout: 260 seconds]
Bike has joined #lisp
cosimone has joined #lisp
karlosz_ has quit [Quit: karlosz_]
gareppa has quit [Quit: Leaving]
eddof13 has joined #lisp
varjag has joined #lisp
shka_ has joined #lisp
varjag has quit [Client Quit]
varjag has joined #lisp
cosimone has quit [Quit: WeeChat 2.4]
shka_ has quit [Ping timeout: 245 seconds]
Mandus has quit [Ping timeout: 258 seconds]
Mandus has joined #lisp
cosimone has joined #lisp
longshi has joined #lisp
fortitude has joined #lisp
gxt has joined #lisp
saravia has joined #lisp
Oladon_work has joined #lisp
orivej has joined #lisp
JohnMS has quit [Quit: Konversation terminated!]
longshi has quit [Ping timeout: 268 seconds]
nydel has quit [Changing host]
nydel has joined #lisp
shka_ has joined #lisp
johnp has joined #lisp
<johnp>
I am trying to learn Common Lisp by building (of all things) a scheme interpreter (I know scheme pretty well from reading HTDP and SICP). What's confusing me right now is comparing symbols. I made myself a package for my interpreter that I'm loading in the REPL and in unit tests. The problem is that the 'define symbol (or any syntax symbol I look for) gets interned inside my scheme package, so comparing the symbol 'define inside the
<johnp>
eval procedure is not equal to a symbol given to it in the reader (e.g. typing (schemeval '(define (f x) (* x x)) environment) doesn't work because 'define is not equal). Is the best practice for this situation to use string=?. Seems to be the only option but it seems awkward and certainly very different from scheme.
orivej has quit [Ping timeout: 244 seconds]
karlosz has quit [Read error: Connection reset by peer]
karlosz_ has joined #lisp
karlosz_ is now known as karlosz
orivej has joined #lisp
<Bike>
johnp: just make sure you do your reading in your interpreter package.
<Bike>
don't use string=. they are symbols.
<Bike>
If you're in a repl you can do (in-package #:scheme-eval) or whatever your package is called, and then subsequent lines will be read in that package.
milanj has quit [Quit: This computer has gone to sleep]
<pjb>
johnp: so, the trick is that READ calls INTERN with the value bound to *PACKAGE* as second argument.
<pjb>
johnp: *package* is the current package, at read-time. When the compiler calls READ at compilation time, it's the current *package* at compilation-time, which normally has been set by a previously read and evaluated (in-package …) form in the same file. When you call READ at run-time, it's the current *package* at run-time. eg. the current *package* in the REPL, unless you explicitely rebind *package* in your program.
orivej has quit [Ping timeout: 272 seconds]
<pjb>
johnp: what you want, is that when we read "define", you get actually the symbol your-scheme-implementation:define. For this, you must ensure that this your-scheme-implementation:define symbol be present in the current *package* at run-time, when you call READ.
<pjb>
so that (intern "DEFINE" *package*) will actually find this symbol YOUR-SCHEME-IMPLEMENTATION:DEFINE in the package bound to *PACKAGE*.
<pjb>
johnp: You can do that by _using_ the package YOUR-SCHEME-IMPLEMENTATION in the current run-time *package*.
<pjb>
johnp: perhaps RUN is not a scheme function, (it's a CL function implementing your scheme); then you could split "YOUR-SCHEME-IMPLEMENTATION" package into two packages, one for the scheme symbols, and one for the implementation, and both the implementation and the user package would use the scheme package.
<pjb>
johnp: notice that there's the pseudo-scheme implementation (r4rs); you may want to have a look at it.
<johnp>
pjb: Okay. So in a nutshell just make sure I'm in the same package that I'm doing eql comparisons with when I read?
<johnp>
Or otherwise send in the input.
<pjb>
johnp: you can use this simplification, but in general you would want to avoid reading at run-time in an implementation package, since that would intern all the user symbols in this package.
<pjb>
johnp: if you use a user package, you can delete it and recreate it to start from scratch, and garbage collect the user symbols previously interned.
<pjb>
Then in addition to binding *package* you will also want to bind *readtable* with a readtable configured by specific reader macros to read scheme code.
<johnp>
Oh I see.
<pjb>
and a few other variables in the *print-…* and *read-…* lists…
<pjb>
where you would have wrapped encapsulated all those details in the with-scheme-syntax macro.
<johnp>
Well maybe not. So you bind *package* to the user package at run time. And when you call (read) it reads the global *package* variable which is still set to my custom evaluator.
<pjb>
johnp: The problem is that you wrote "doing eql comparsions". This is meaningless.
<pjb>
johnp: EQL doesn't work with packages.
<johnp>
eql on symbols.
<pjb>
Yes, it works on symbols. Symbols have identity.
<pjb>
So you write the call to eql in a function that is read in a given package, so if you use some literal unqualified symbol to refer so specific symbol, it will have to be present in the package used at compilation-time to read this code (the quote form).
<johnp>
If I'm not in the same package (scheme-interpreter:schemeval '(define (f x) (* x x)) env) doesn't work because if I ask if the expression is a define with (eql (car expr) 'define) returns false.
<johnp>
In that example I was in the CL-USER package.
<pjb>
But that call to eql is executed at run-time with possibly a different current package. If you just use the same package as used at compilation-time, it means this your-scheme-implementation package, and the other user symbols will be interned in it. (and the user will also have access to your other implementation symbols).
<pjb>
He will be able to refer to implementation internals…
<pjb>
johnp: notice how you are in the CL-USER = COMMON-LISP-USER package!
<pjb>
Why are you entereing SCHEME code in the COMMON-LISP-user package?
<pjb>
(in-package "SCHEME-USER") in the REPL, and then you'll be ok.
<pjb>
(if you define this package as wanted).
paul0 has quit [Ping timeout: 244 seconds]
<johnp>
Mostly trying to write unit tests.
<pjb>
Don't write scheme code in the common-lisp-user package.
<johnp>
The unit test package I was using required me to be in it's own package, not sure why. Or it seemed that way.
<johnp>
So although I wasn't in common-lisp-user I was still not in the scheme-user package.
<johnp>
s/scheme-user/scheme-interpreter/
<pjb>
Otherwise, you can either: (scheme-interpreter:schemeval (with-scheme-syntax (read-from-string "(define (f x) (* x x))")) env)
<pjb>
You can also define a CL reader macro, perhaps #\{, so instead of writing (scheme-interpreter:schemeval (with-scheme-syntax (read-from-string "(define (f x) (* x x))")) env) you can write (scheme-interpreter:schemeval { (define (f x) (* x x)) } env)
<pjb>
This could be handy if you have a lot of test cases…
iarebatman1 has joined #lisp
<johnp>
Okay thanks. I should be able to get it working now. Doing a simple in-package works, thanks for the explanation about *package* and symbols.
<pjb>
Oh, it seems the link is still alive. (at the bottom)
<johnp>
Okay I've actually been to that website before, but I was looking at answers in scheme.
<pjb>
Somebody did it in C++…
<shka_>
it is possible but time consuming
<shka_>
translation to CL is actually fairly simple
vlatkoB has quit [Remote host closed the connection]
fortitude has quit [Ping timeout: 245 seconds]
oni-on-ion has quit [Remote host closed the connection]
<johnp>
lol C++
oni-on-ion has joined #lisp
<shka_>
johnp: possible, just requires sick amounts of time
eddof13 has quit [Quit: eddof13]
cosimone has quit [Quit: WeeChat 2.4]
cosimone has joined #lisp
cosimone has quit [Client Quit]
eddof13 has joined #lisp
xivh has joined #lisp
maxxcan has joined #lisp
gravicappa has quit [Ping timeout: 244 seconds]
xantoz has quit [Quit: WeeChat 2.5]
xantoz has joined #lisp
warweasle has joined #lisp
slyrus__ has joined #lisp
slyrus1 has joined #lisp
<iarebatman1>
Can anyone lend a quick hand with spacemacs? I'm trying to use evil-cleverparens with my CL files..
<iarebatman1>
It works when I manually toggle evil-cleverparens-mode while in a *.lisp file, but I cannot get it to auto-enable when I open the file for whatever reason..
<aeth>
vms14: And now foo has all of CL except for +
<aeth>
vms14: and you can manually cl:+ if you need it in your definition of +
<vms14>
lol tnx
<vms14>
aeth: that's what I wanted, access the + function trough cl:+
<vms14>
thanks to all and sorry for such a noob question, cause I knew about shadow
Oladon_work has quit [Ping timeout: 260 seconds]
<aeth>
vms14: And on top of that, what I've done before to avoid messing with too many packages is have a macro that locally chooses which + etc to use by leaving + undefined outside of that macro, which I think could be as simple as (inlined) flet or macrolet. It's been a while, though. The downside is it might kill optimizations, and you might have to restrict yourself to keeping it fixed-length instead of arbitrary-length
<aeth>
It can get very elaborate
<vms14>
I was thinking in make a macro
<vms14>
what I want is to mix html css and js in one language
<vms14>
and have something like
<vms14>
(title "this is the title" :color 'red)
<aeth>
Well, for that you don't need CL functions at all. You can just sort of... write an interpreter of sorts, where you dispatch based on the CAR of a list and go through recursively.
Bike has joined #lisp
<vms14>
this should be converted to one h1 and maybe the title of the head tags
<aeth>
(And if you use functions then the name doesn't have to match the car)
<vms14>
aeth: that was my first approach
<vms14>
and made a function which translates input to a list
<aeth>
What made you abandon that approach?
<vms14>
nothing really
<vms14>
I was thinking in something more direct
<aeth>
The problem with a direct approach is if you want to make it print as a human would, unminified and with indentation at the proper levels. It's not impossible in CL because you can just use dynamic, global variables for that, though.
<aeth>
You're still going to want to have it write to a stream instead of literally being direct because otherwise you're concatenating quite a few strings that you're consing up
<vms14>
yeah, and I'm so noob to do such a thing anyway xD
<vms14>
I'll try with what I've started
xkapastel has joined #lisp
<aeth>
For example, (+ 1 (* 3 5) 7) to "1 + (3 * 5) + 7" means that you're going to have to track several things. e.g. the indentation level if you have to break into a newline (you probably don't here). You're also going to naively do something like "~A + ~A + ~A" where 1 is to-string, (* 3 5) is to-string, and 7 is to-string. This will generate quite a few strings.
<aeth>
But if you use a stream, you can just make sure the order of evaluation is correct (which I guess is mainly just not using threads?).
<aeth>
With streams, it will write "1 + (" and then go into the subroutine, write "3 * 5", and then go back out to the main function and write ") + 7"
<aeth>
I guess if you want to do it strictly with functions you can have it write to *standard-output* and just rebind that if you want it e.g. as a string
<aeth>
For my approach for this sort of thing, I have a stream as the last argument, though.
<aeth>
I hope I was clear. I didn't have anywhere near enough coffee today.
milanj has joined #lisp
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
Aruseus has joined #lisp
<vms14>
aeth: right
<vms14>
that's also why I love that format writes to char arrays
<vms14>
(make-array 0 :element-type 'character :adjustable t :fill-pointer t )
azrazalea has quit [Remote host closed the connection]
azrazalea has joined #lisp
<aeth>
I think we had this conversation a while ago (or at least someone did). I still prefer streams here for their simplicity, just using with-output-to-string. This means that FORMAT has (at least) 3 different ways to write a string, though.
schjetne has quit [Ping timeout: 245 seconds]
ltriant has joined #lisp
random-nick has quit [Read error: Connection reset by peer]
Mandus has quit [Ping timeout: 248 seconds]
Mandus has joined #lisp
eddof13 has quit [Quit: eddof13]
saravia has quit [Remote host closed the connection]
oni-on-ion has quit [Ping timeout: 264 seconds]
Ricchi has joined #lisp
iarebatman1 has joined #lisp
torbo has joined #lisp
lucasb has quit [Quit: Connection closed for inactivity]
kajo has quit [Quit: From my rotting body, flowers shall grow and I am in them and that is eternity. -- E. M.]