<|3b|>
let me know if anyone sees anything obviously wrong, or suggestions for other C/CL libs worth including by default (went ahead and added some common ones to reduce build time, but people can overwrite parts of the ql dir with one in their submission for full control)
orivej has quit [Ping timeout: 258 seconds]
orivej has joined #lisp
sjl has quit [Ping timeout: 272 seconds]
EvW has quit [Ping timeout: 256 seconds]
orivej has quit [Ping timeout: 246 seconds]
orivej has joined #lisp
bitmapper has quit [Ping timeout: 256 seconds]
PuercoPop has joined #lisp
orivej has quit [Ping timeout: 256 seconds]
orivej_ has joined #lisp
mindCrime has quit [Quit: Konversation terminated!]
gjulio__ has joined #lisp
terpri_ has joined #lisp
terpri has quit [Ping timeout: 260 seconds]
cranes has joined #lisp
freshpassport has joined #lisp
lansiir has quit [Ping timeout: 256 seconds]
oldtopman has joined #lisp
karlosz has quit [Quit: karlosz]
Bike has quit [Quit: leaving]
Oladon has joined #lisp
edgar-rft has joined #lisp
ahungry has joined #lisp
ckonstanski has joined #lisp
catern has quit [Excess Flood]
catern has joined #lisp
jesse1010 has quit [Ping timeout: 256 seconds]
dyelar has quit [Quit: Leaving.]
dominic34 has joined #lisp
<Oladon>
I find myself needing to write a new combination Markdown (probably Commonmark?) + BBCode parser. What's the best approach, architecture/organization-wise, to ensure maximum utility for others while still attaining my aim of a combination parser?
<beach>
Good morning everyone!
<Oladon>
Morning, beach!
karlosz has joined #lisp
orivej_ has quit [Ping timeout: 246 seconds]
orivej has joined #lisp
akoana has quit [Quit: leaving]
orivej has quit [Ping timeout: 272 seconds]
orivej_ has joined #lisp
madage has quit [Ping timeout: 240 seconds]
madage has joined #lisp
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
orivej_ has quit [Ping timeout: 264 seconds]
orivej has joined #lisp
JohnTalent has quit [Ping timeout: 246 seconds]
dominic34 has quit [Ping timeout: 260 seconds]
orivej has quit [Ping timeout: 272 seconds]
<gjulio__>
morning beach
<gjulio__>
Hey is anyone willing to share a snippet of a .gitattributes file for handling control-m line endings in a *.lisp file? I've been trying a million tactics and I can't seem to resolve the problem.
ebrasca has joined #lisp
cyberbanjo_ has joined #lisp
gravicappa has joined #lisp
bhartrihari has left #lisp ["Disconnected: Replaced by new connection"]
bhartrihari has joined #lisp
<beach>
gjulio__: I suspect few people here have that problem.
bhartrihari has left #lisp ["Disconnected: Replaced by new connection"]
<gjulio__>
i solved it. added *.lisp text eol=crlf to .gitattributes. then added (add-hook 'before-save-hook 'delete-trailing-whitespace) to .emacs and then created new files, moved my lisp file to the new file, added the new file to my git repo, and now it's working. it seems like the *.lisp text eol=crlf stuff isn't retroactive. maybe i'm wrong?
bhartrihari has joined #lisp
<fe[nl]ix>
I conform it's not retroactive
<fe[nl]ix>
are you using Windows ?
<gjulio__>
linux
<fe[nl]ix>
then what do you need that for ?
<gjulio__>
what do i need what for?
dvdmuckle has quit [Quit: Bouncer Surgery]
<beach>
Why do you have CR characters in your files?
<gjulio__>
not sure. i did edit parts of the file on a different computer that was windows, maybe it's from that?
dvdmuckle has joined #lisp
<beach>
Very likely.
Oladon has quit [Quit: Leaving.]
narimiran has joined #lisp
ebrasca has quit [Remote host closed the connection]
froggey has quit [Ping timeout: 260 seconds]
shangul has joined #lisp
froggey has joined #lisp
Oladon has joined #lisp
bocaneri has joined #lisp
Oladon has quit [Client Quit]
shangul has quit [Remote host closed the connection]
shangul has joined #lisp
<fe[nl]ix>
gjulio__: convert all CRLF line endings to LF and configure your Windows editors to use LF as well
<gjulio__>
thanks. i'm usually using linux, but i'll keep that in mind if i need to switch back.
JohnMS_WORK has joined #lisp
shka_ has joined #lisp
shka_ has quit [Read error: Connection reset by peer]
shka_ has joined #lisp
gaqwas has joined #lisp
gaqwas has joined #lisp
gaqwas has quit [Changing host]
shka_ has quit [Read error: Connection reset by peer]
ayuce has quit [Remote host closed the connection]
<Xach>
clintm: yoinks
<Xach>
ha
sjl has joined #lisp
kmeow has joined #lisp
jeosol has quit [Remote host closed the connection]
freshpassport has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<aeth>
phoe: Not yet
<aeth>
hopefully at some point this week
Bourne has quit [Ping timeout: 240 seconds]
jonatack has quit [Ping timeout: 256 seconds]
jmercouris has quit [Remote host closed the connection]
dominic34 has joined #lisp
pve has quit [Ping timeout: 272 seconds]
bhartrihari has left #lisp ["Disconnected: Replaced by new connection"]
dominic35 has joined #lisp
rogersm has quit [Quit: Leaving...]
dominic34 has quit [Ping timeout: 246 seconds]
dominic35 is now known as dominic34
jcowan has joined #lisp
pfdietz has joined #lisp
<jcowan>
What are the most common use cases for the syntaxes #n= and #n#, as opposed to the data structures they represent? Is it genuinely common to serialize such things as S-exprssions?
<_death>
you do need forward references for cyclic graphs.. this is the same issue that CL designers solved in make-load-form by having it return a creation form and an initialization form
<phoe>
I guess that this is because multiple MAKE-LOAD-FORMs do not necessarily depend on the slots of one another, whereas the above is just one big ball of cyclic references printed as a whole
<beach>
_death: I am not sure I follow. Try '#1=(a .#1#) at the REPL.
<phoe>
and also because the above utilizes the reader
<phoe>
whereas MAKE-LOAD-FORM must return a Lisp form, which is already post-READ
<beach>
_death: The reader patches the graph after it has been read.
pve has joined #lisp
<beach>
So when it sees #1#, it sticks in some unique temporary object, and enters the correspondence in a table. Then when the entire expression (in this case a single CONS cell) has been read, the graph is traversed, and the temporary object is replaced by what was returned as #1=.
<_death>
I know about the reader syntax.. but as you say it needs to patch things
<beach>
Absolutely.
<beach>
And it does.
pfdietz has joined #lisp
<_death>
so while the form looks like it supplies initargs, it's actually patching the slots?
<beach>
I guess this feature (and its power) is little known, hence the question from jcowan. I think it is fantastic and, like I said, I use it all the time.
<phoe>
not the slots I guess
<phoe>
the lists that are being read
bsd4me has joined #lisp
<phoe>
and once the list is fully read and patched, APPLY #'MAKE-INSTANCE is called on it
<phoe>
that's how I understand it
<beach>
_death: In my examples, if it sees :some-initarg #n#, it is replaced by :some-initarg <unique>
<beach>
_death: Then, if it turns out that :some-initarg stores <unique> in a slot, then it is patched later.
<_death>
I see
<phoe>
and I assume that all of this patching is done by the reader on the lists, before any MAKE-INSTANCE is even called
<TMA>
unless #n# is encountered before #n=, there is no need to patch if you can construct the object in some incomplete state (the state between allocate-instance and initialize-instance)
<beach>
phoe: Why do you assume that?
<Bike>
TMA: but the reader doesn't know how to do that.
bhartrihari has joined #lisp
<jackdaniel>
had there been instances to be serialized, then the reader macro [ wouldn't make sense
<phoe>
beach: you said, "[ is (apply #'make-instance (read-delimited-list....))"
<jackdaniel>
and there is no need to define a method on make-load-form on simple objects, like 3 or :staff
<phoe>
this means that READ-DELIMITED-LIST must finish operating before MAKE-INSTANCE is called
<beach>
phoe: Yes, and the patching is done on the created instance.
kmeow has quit [Ping timeout: 260 seconds]
<beach>
Oh, sure.
<beach>
But no patching takes place then.
<phoe>
which means that the reading (including the patching!) must be complete before MAKE-INSTANCE is called
<beach>
Why do you make that conclusion?
bhartrihari has left #lisp ["Disconnected: Replaced by new connection"]
bhartrihari has joined #lisp
EvW1 has joined #lisp
ebrasca has joined #lisp
<jcowan>
beach: _death is correct, 2.4.8.16 explicitly forbids forward references with #n#, so no patching is necessary.
<Bike>
reading a standard-object with circular references in it isn't much different from reading a vector with em
<phoe>
because #1= must happen before #1# - if the reader stores the EQ references in some sort of read-time hash table, it can then directly look up the object and insert it there
<beach>
phoe: Suppose I have #1=[MY-CLASS :stuff #1#]
<phoe>
oooh. that's no list.
<phoe>
that's a standard object with an initarg.
<phoe>
you can't have an instance before calling MAKE-INSTANCE so there is nothing to insert there.
<phoe>
right, I see it now.
<beach>
phoe: First (my-class :stuff #1#) is read, but since we don't know #1#, we replace it with <mumble> and then we call (make-instance 'my-class :stuff <mumble>)
<beach>
phoe: Then the result of that creation is assigned to #1=.
<beach>
Finally, we traverse the graph, find that some instance of my-class has <mumble> in it.
<beach>
So we replace that occurrence with the intance.
<beach>
instance.
<beach>
phoe: Is that clear now?
FreeBirdLjj has quit [Remote host closed the connection]
<jcowan>
I'm talking only about what has to happen at read time.
<beach>
jcowan: That is precisely what we have been showing in detail.
<phoe>
beach: yes, that's clear now. Thanks.
<jcowan>
#1=[MY-CLASS :stuff #1#] is not readable.
<beach>
Sure it is.
<beach>
That's how I read it.
<beach>
Like I said, [ is a reader macro that does (apply #'make-instance (read-delimited-list ...))
<_death>
beach: but why use make-instance and not allocate-instance then?
ayuce has joined #lisp
<beach>
Why would I do that?
<jcowan>
Sorry, I missed that about [
FreeBirdLjj has joined #lisp
<_death>
beach: well, what is <mumble>? if the slot has a :type integer it must be an integer or a special value indicated that the slot is unbound
<_death>
*indicating
ayuce has quit [Read error: Connection reset by peer]
<beach>
_death: I am sure that type checking is disabled during reading.
<beach>
Or maybe it uses an instance of the type that the slot has, if it is a slot.
<beach>
If the slot is unbound, then obviously it does not need patching.
<Bike>
this same problem comes up with the #s reader, which is standard.
<_death>
beach: ok.. an alternative design would be to use the two forms from make-load-form..
<beach>
_death: An alternative design for what?
<_death>
for the external format exemplified by the .gsh file
<beach>
Why would I make life harder for myself? The reader can already do this.
<beach>
I would have to traverse the graph myself then.
<beach>
Now, I just do (PRINT ...)
<_death>
but do you just READ?.. you said that the slots need patching afterwards
FreeBirdLjj has quit [Ping timeout: 260 seconds]
<Bike>
that's the standard ## macro stuff, beach doesn't have to write it
<beach>
READ patches automatically.
<beach>
_death: I just do (READ).
catern has quit [Excess Flood]
<_death>
I guess because you defined the #\[ reader macro
catern has joined #lisp
<beach>
That's so that I can print standard objects.
<_death>
right.. in a readable way
<beach>
Yes, it would be foolish to do otherwise. :)
nikkal has quit [Remote host closed the connection]
<beach>
For each class, I also have to give pairs :initarg reader corresponding to the protocol that the class respects.
<_death>
the analogue of make-load-form-saving-slots?
<beach>
Probably not quite. There are no slots mentioned here.
<beach>
I can have a class with a slot AGE but produce initargs :DATE-OF-BIRTH DATE-OF-BIRTH.
ayuce has joined #lisp
<_death>
right, so you do that on the level of initargs
<beach>
And, also, if I were to use make-load-form... I would have to LOAD the file, right?
<_death>
yes, you'd need to evaluate the forms
<beach>
That's very dangerous.
<_death>
READing is also dangerous :)
<beach>
Why?
<beach>
I obviously disable #.
<phoe>
_death: so is loading FASLs
<Bike>
make-instance has arbitrary behavior, so it's going ot be dangerous
FreeBirdLjj has joined #lisp
<beach>
_death: The initarg and the reader are part of the protocol and I want the saved file to create a graph using the protocol. That way, I can change the physical structure between save and load.
<_death>
I guess READing is dangerous because you don't have that much control over the reader
<Bike>
you don't have much control over the loader either. i don't understand the debate here
<Bike>
you can easily get arbitrary code evaluated either way
<Bike>
i mean there's no way to allocate an instance without calling allocate-instance, which can have whatever user methods
<beach>
Bike: How would you do that with make-instance?
<beach>
Bike: If I don't allow external code to be loaded, how do those method come into existence?
JohnTalent has joined #lisp
<Bike>
well that sounds more like you can't execute arbitrary code either way
<_death>
I mean dangerous in that it there are arbitrary limits you can't control when invoking the reader
<beach>
Whatever. I think I am too tired for this.
<_death>
for example the length and depth of lists, symbol names, magnitudes of numbers, etc.
<beach>
Yeah, I should have used make-load-form instead. My bad. Sorry.
<_death>
no
rgherdt has quit [Quit: Leaving]
<phoe>
_death: I assume that the FASL files are trusted and don't contain hostile data
<beach>
This kind of exchange makes me upset, so I'll quit now.
<phoe>
such as a class name that is ten gigabytes long
FreeBirdLjj has quit [Remote host closed the connection]
joels has joined #lisp
<Bike>
you're arguing about which of two standard mechanisms to use and both of thos emechanisms are chock full of hooks to do arbitrary things at arbitrary times, so you have to control what files are being loaded or something. both can deal with circular structures and custom object definitions.
<_death>
beach: this is unrelated to the make-load-form remarks.. I'm just saying READ is "dangerous" too :).. I did not mean to say that the make-load-form design is better or anything, just tried to understand this format
<beach>
I don't care anymore.
rgherdt has joined #lisp
FreeBirdLjj has joined #lisp
tich has quit [Remote host closed the connection]
theseb has joined #lisp
<theseb>
What is easiest way to implement *global variables* in a common lisp like implementation I wrote?
FreeBirdLjj has quit [Ping timeout: 246 seconds]
<theseb>
What I mean is....I want to set x in a function and then have value OUTSIDE the function be modified
<theseb>
possible?
<theseb>
e.g. x = 3 ; set x = 4 in f(x) ; print x outside of f and get 4
knuckles has quit [Ping timeout: 246 seconds]
<beach>
theseb: Most existing Common Lisp implementations have a slot in the symbol.
<phoe>
alternatively you can make some sort of global hashtable whose keys are symbols and whose values are variable values
<beach>
theseb: Not that I know how your implementation works. I am just telling you what is usually done.
gjulio__ has joined #lisp
<beach>
theseb: The advantage of the symbol slot is that the symbol becomes available to the program at read time, so it is just an indirection to set the value.
<beach>
theseb: The hash table solution is slower, because you need, well, a hash-table access for each operation.
<theseb>
phoe: if a global table sets variable x to equal variable y...what do you do next? i'm intrigued
<beach>
theseb: Common Lisp doesn't work the way you may think.
JohnTalent has quit [Ping timeout: 256 seconds]
<beach>
Assigning doesn't create a link between variables.
<beach>
The value of one is accessed and then given to the other.
<beach>
Just like any programming language.
rgherdt has quit [Remote host closed the connection]
<phoe>
theseb: (defvar *x* 42) (defvar *y* *x*)
<phoe>
*y* is 42
<theseb>
phoe: yes
<phoe>
don't know what you expect
<phoe>
(setf *x* 24)
<phoe>
*x* is 24, *y* is 42
<theseb>
phoe: right
<phoe>
same if you use a hash table
jcowan has quit [Remote host closed the connection]
<Bike>
so what does your "I'm intrigued" comment mean.
<Bike>
what is intriguing
<theseb>
phoe: i understand all that but how will that help me modify *x* or *y* in a function f?
rgherdt has joined #lisp
<Bike>
the function modifies the hash table.
<phoe>
you grab the symbol itself and use it as a key to the hash table
<theseb>
Bike: intriguing because slots sounded complicated but variable setting is something i can do and understand
<phoe>
that's how you can modify the hash table
<Bike>
i don't think any of these implementations of global variables is very complicated. neither is the sicl one
nikkal has joined #lisp
<Bike>
it does get complicated when you start having local specials and thread locality, but for globals, whatever
nicktick has quit [Quit: Leaving.]
<beach>
I am guessing that theseb doesn't know how to get the symbol into the executable code.
<phoe>
just quote it
<beach>
phoe: This is not Common Lisp.
<phoe>
...if your language has a quote
<theseb>
Bike: to give you context.....the reason this came up is i'm implementing a print function by appending to a global variable called output
<theseb>
i.e. when you "print" you store strings in a list called the output list
<beach>
But then, it all depends on the implementation, and I suspect it is very different from the way Common Lisp and indeed other languages as well, are implemented.
<theseb>
I was having trouble modifying this output list in some places
<theseb>
errr i could modify it anywhere I wanted but the changes would disappear once I left a scope ;)
ArthurStrong has quit [Ping timeout: 240 seconds]
<Bike>
i don't think the context matters. it's pretty simple. you have a persistent hash table and you modify that table
edgar-rft has quit [Quit: Leaving]
<Bike>
i have no idea what your language targets or anything. maybe it's not image based. in that case you'd be really far off topic for this channel
<beach>
theseb: Your questions are essentially about how to implement a programming language. That is really too general for #lisp. If you want to know how to implement Common Lisp, we can help you with that, but it is nearly impossible for us to debug a problem in your own implementation of a language that is not Common Lisp.
<beach>
And a very special implementation too, it seems.
<theseb>
my language is basically what SICP says
pfdietz has quit [Remote host closed the connection]
<phoe>
then you could use the knowledge SICP provides about environments
<beach>
theseb: Do you have READ?
<Bike>
sicp probably uses alists. same principle.
<theseb>
What do you think of this...I'm going to open source a project called "Program To Processor"....you start with a minimal Python variant called Snake and convert to AST...then convert the AST to a minimal intermediate Lisp code...then to a simple virtual processor...All the parts are written in python for easy reading
nicktick has joined #lisp
<theseb>
So basically the entire stack and all code in all layers will be accessible and understandable in python
<Bike>
i mean i like lisp better than python, which is why i'm in the lisp channel and not the python channel.
<theseb>
so my little lisp thing is the executable intermediate code layer
nikkal has quit [Remote host closed the connection]
<theseb>
I need to have it as simple as possible so students can grok whole thing
<beach>
It sounds complicated already.
<theseb>
Bike: i see part of this project as a way to introduce Lisp as well
<jackdaniel>
python with all its arbitrary syntactic rules (and oh my god spaces) is not easy to read, at most it is easy to evangelise as easy to read :)
<Bike>
you can teach in lisp. that's what sicp is, after all.
<theseb>
Bike: "Oh wow that intermediate language is really cool and elegant!"
<theseb>
"i want to learn more about this lisp thing"
<theseb>
"Is is like a lean slimmed down python!"
Bike has left #lisp [#lisp]
narimiran has quit [Ping timeout: 272 seconds]
<jackdaniel>
I think that this is as far from Common Lisp as one could get having parenthesis involved
<theseb>
jackdaniel: ;)
FreeBirdLjj has joined #lisp
<joels>
There's always value in spreading some lisp in areas where there is none
<jackdaniel>
and by saying taht I meant that this is offtopic on this channel
<theseb>
jackdaniel: i guess i'm becoming the black sheep of the channel
<beach>
theseb: You are asking impossible questions, and you don't understand the recommendations, so it is very frustrating.
<theseb>
beach: sorry i'm slow....i think i understand why a hashtable is the answer now....if you modify e.g. x=4 in a function those changes will disappear when you leave scope but if x = more complex object like a hash table then changes will survive when you leave scope....is that it?
<phoe>
wait a second
<phoe>
X is a global variable
<phoe>
so it will never go out of scope
<phoe>
so scopes are totally irrelevant
<beach>
theseb: x is not a hash table. It is a symbol, and it is used as a key in a hash table.
dddddd has quit [Ping timeout: 258 seconds]
<beach>
That's an example of what I was just saying.
<theseb>
beach: oh you pass in the *key* to the function
<phoe>
yes, that's what I said twenty minutes ago
<phoe>
17:13 < phoe> you grab the symbol itself and use it as a key to the hash table
<theseb>
not sure why i'm so slow to "get" this stuff
<beach>
x = 4 becomes (setf (gethash 'x *global-hash-table-containing-global-values*) 4)
<beach>
theseb: My hypothesis is that it is time for you to read about compiler design as opposed to guessing how it might be done.