<pjb>
jcowan: or just writting a backend to an existing CL implementation.
<pjb>
A easy way to do it, for example, would be to implement the clisp VM in js.
<pjb>
Another would be to write SBCL VOPs for js.
<moon-child>
pjb: tools exist to compile c to js; those could be used for clisp or ecl
<pjb>
Indeed.
random-nick has quit [Ping timeout: 246 seconds]
sjl has joined #commonlisp
waleee has quit [Ping timeout: 268 seconds]
leeb_ has quit [Quit: WeeChat 3.1]
srhm has joined #commonlisp
srhm has quit [Read error: Connection reset by peer]
srhm has joined #commonlisp
srhm has quit [Client Quit]
phantomics has quit [Ping timeout: 272 seconds]
tyson2 has quit [Remote host closed the connection]
IAmRasputin has joined #commonlisp
IAmRasputin has quit [Ping timeout: 250 seconds]
[deleted] has quit [Read error: Connection reset by peer]
livoreno has joined #commonlisp
prxq_ has joined #commonlisp
prxq has quit [Ping timeout: 252 seconds]
bhaible has quit [Remote host closed the connection]
bhaible has joined #commonlisp
seok has joined #commonlisp
bhaible has quit [Remote host closed the connection]
<beach>
Good morning everyone!
<kakuhen>
hi
<kakuhen>
What regular expression is most used by CLers? I'm assuming cl-ppcre
<kakuhen>
regular expression library*
<Bike>
probably ppcre, but there are some other good ones
<Bike>
i think
<beach>
Maybe some people were asleep when I suggested a project 12 hours or so ago, so let me repeat it:
<beach>
Write a "magit"-like pane for McCLIM. And presumably call it "McGIT".
<beach>
It would have clickable presentations in addition to keyboard shortcuts, so that the mouse could be used, with context menus and such.
bhaible has joined #commonlisp
<beach>
I don't know whether vim has something like magit, and if not, I would think such a project would be attractive to users of vim.
<beach>
And splittist pointed out to me that Shinmera has written "legit" which is a Common Lisp library for interfacing with GIT, so that part is partly done.
silasfox has quit [Ping timeout: 244 seconds]
silasfox has joined #commonlisp
<moon-child>
I have never found git 'frontends' very interesting, but I hear good things about And it encourages lots of monomorphization in e.g. ranges. fwiw
bhaible has quit [Remote host closed the connection]
bhaible has joined #commonlisp
Bike has quit [Quit: sleep]
<beach>
A McCLIM pane would still be useful of course, and it would be an essential part of a future IDE for Common Lisp.
Lord_of_Life has quit [Ping timeout: 250 seconds]
bhaible has quit [Remote host closed the connection]
bhaible has joined #commonlisp
Lord_of_Life has joined #commonlisp
<moon-child>
I wonder the extent to which it's meaningful to create an 'IDE' vs a general window-management paradigm which can be used to organize arbitrary tools; including those which are used for software development, but not limited to them
<beach>
Well, I write IDE, but that's the kind of architecture I am thinking of.
<beach>
I am thinking of a collection of pane classes for McCLIM that the user can then assemble in various ways. So McCLIM would act as a "window manager".
<beach>
Like an editor pane, a debugger pane, an inspector pane, a backtrace-inspector pane, a GIT pane, an ASDF pane, etc.
<moon-child>
I see
klltkr_ has quit [Ping timeout: 244 seconds]
<beach>
I think for Common Lisp users, there is no other choice, because people have individual preferences that can't be met by one common design.
<beach>
Plus, it's a development environment for Common Lisp written in Common Lisp, so programmers are capable of doing the "pane assembly" themselves.
<beach>
But the important part here is that these tools can collaborate, which is made easier with CLIM presentations and such.
<rdrg109>
The reason why I used let in my example is because I use let for writing minimal working examples. Thus, I can see the behavior of functions without cluttering my SLIME REPL session with global varaibles. I guess I need to stop doing that and use defvar instead. Is that right?
<beach>
Your technique for inserting is correct, and the code in that link is really bad in many ways.
<beach>
But you can't use '(1 2 3) because that is a literal object.
<mfiano>
rdrg109: ' is a reader macro that expands into (quote ...). As the name suggests, a reader macro applies its transformation at read time, before any code is compiled.
<beach>
So use (list 1 2 3) instead.
<mfiano>
Such reader macros can be assumed to create "literal objects"
<rdrg109>
As someone coming from Emacs Lisp, I found that disturbing because I've been using that in all my Elisp code.
<mfiano>
These forms should never be mutated, instead copied or created at runtime. This is because they are expanded at read-time, and thus are embedded into compiled code.
<beach>
rdrg109: Let me give you an example of why you should not do that. Try this: (defun ff () '(1 2)) then (defparameter *l* (ff)) then (setf (car *l*) 234) then (ff).
<beach>
rdrg109: You see, Common Lisp uses what I call "uniform reference semantics" meaning that, semantically speaking, every object is manipulated indirectly through a reference or a pointer. So there is only one list object containing the elements 1 and 2, and that same object is returned each time FF is called.
<beach>
So when you do the (SETF (CAR *L*) ...) you are modifying that object.
<beach>
And the next time FF is called, a modified object is returned.
<beach>
rdrg109: You should consider yourself lucky that SBCL was able to catch the problem this time. It is not always that easy, and you can have some very strange bugs that are difficult to find if you modify literal data.
<moon-child>
beach: apparently, the emacs lisp of the code that you showed will run without error, with ... consequences
<beach>
rdrg109: So, you should not do that in Emacs Lisp either.
<mfiano>
Whether a warning/error is raised is just a convenience. It could just as well launch nethack :)
<mfiano>
s/raised/signalled
<beach>
Yeah.
<beach>
rdrg109: Does that make sense to you?
<beach>
rdrg109: It is time to go over all your Emacs Lisp programs and make sure you don't modify literal data.
<mfiano>
It may be unintutive, but Lisp gives us access to different stages of the compiler, within other stages.
<moon-child>
a perhaps somewhat more practical consideration is interning. An implementation could very plausibly return 5, given the following: (let ((x '(1 2)) (y '(1 2))) (setf (car x) 5) (car y))
<mfiano>
Consider what would happen if you mutated other literal objects, such as a literal integer of 42 (not that you can without some serious hackage).
<rdrg109>
Thank you all for asnweing my question deeply. It is of much help. I guess I will have to read more docs and change the mistakes I made
akoana has quit [Quit: leaving]
<rdrg109>
Yes beach, thanks for the help!
<beach>
Pleasure.
derelict has quit [Ping timeout: 272 seconds]
derelict has joined #commonlisp
<pjb>
rdrg109: alteratively you can use copy-list. Notaby in functions that want to modify their parameter, but that can accept literal (immutable) values: (let ((items '(1 2 3))) (let ((items (copy-list items))) (push 4 (cdr (last items))) items)) #| --> (1 2 3 4) |#
<pjb>
rdrg109: or more wisely, write your functions so they don't try to mutate their parameters at all.
<pjb>
rdrg109: ^ note the use of nconc, which mutates the fresh list returned by butlast, so we don't copy it again.
<pjb>
rdrg109: but that expression doesn't touch the literal list items.
<pjb>
So you can use mutation inside your functions as long as you are only mutating objects created by (or for) your function, and not the arguments.
silasfox has joined #commonlisp
lisp123 has quit [Remote host closed the connection]
lisp123 has joined #commonlisp
lisp123 has quit [Remote host closed the connection]
lisp123 has joined #commonlisp
char has quit [Ping timeout: 244 seconds]
lisp123 has quit [Ping timeout: 265 seconds]
Lycurgus has joined #commonlisp
seok has quit [Ping timeout: 244 seconds]
frgo has quit [Remote host closed the connection]
Lycurgus has quit [Quit: Exeunt]
lisp123 has joined #commonlisp
sp41 has quit [Ping timeout: 252 seconds]
lisp123 has quit [Ping timeout: 244 seconds]
IAmRasputin has joined #commonlisp
silasfox has quit [Ping timeout: 272 seconds]
IAmRasputin has quit [Ping timeout: 252 seconds]
wilfred has joined #commonlisp
ad-absurdum has joined #commonlisp
lisp123 has joined #commonlisp
pve has joined #commonlisp
tfb has quit [Quit: died]
amb007 has quit [Ping timeout: 265 seconds]
amb007 has joined #commonlisp
lisp123 has quit [Ping timeout: 250 seconds]
elf_fortrez has joined #commonlisp
CrashTestDummy2 has joined #commonlisp
CrashTestDummy3 has quit [Ping timeout: 252 seconds]
hendursaga has joined #commonlisp
frgo has joined #commonlisp
varjag has joined #commonlisp
cage has joined #commonlisp
Nilby has joined #commonlisp
amb007 has quit [Ping timeout: 258 seconds]
amb007 has joined #commonlisp
shka has joined #commonlisp
lisp123 has joined #commonlisp
<susam>
Good morning, #commonlisp! Hope you are having a good weekend.
<beach>
Hello susam.
<susam>
Hi beach!
davep has joined #commonlisp
lisp123 has quit [Ping timeout: 258 seconds]
<rdrg109>
Good morning!
<Inline>
morning
<rdrg109>
pjb: Thanks for helping! I will need to devote some time to understand what you all mentioned.
frgo has quit [Remote host closed the connection]
<pjb>
or ask for precisions.
<rdrg109>
Fortunately, Org Babel supports Slime code blocks, so having that + irc logs is helpful for taking notes
<pjb>
:-)
<rdrg109>
pjb: I will do that if necessary, thanks!
<susam>
Quick survey: What do you prefer for outputting HTML? Writing HTML using CL macros or writing HTML as plain HTML and combining them with Lisp? And why?
<rdrg109>
s/slime code blocks/lisp code blocks/
<moon-child>
susam: I generally write plain html. Was at one point working on a macro language that would let you write html but without quotation marks around plain text. Never finished that, though
<moon-child>
err, would let you write lisp to forma thtml, but without quotation...
<susam>
moon-child: Okay. Thank you for sharing your style.
<susam>
I have been torn between the two approaches. While writing HTML using CL macros can be convenient as a developer, I worry it would prevent someone else who does not know CL from editing the HTML independently. So far I have been leaning towards writing plain HTML.
Inline has quit [Quit: Leaving]
frgo has joined #commonlisp
Inline has joined #commonlisp
amb007 has quit [Ping timeout: 244 seconds]
blihp has quit [Ping timeout: 272 seconds]
amb007 has joined #commonlisp
CrashTestDummy3 has joined #commonlisp
frgo has quit [Remote host closed the connection]
lisp123 has joined #commonlisp
CrashTestDummy2 has quit [Ping timeout: 268 seconds]
hendursaga has quit [Ping timeout: 244 seconds]
<lisp123>
susam: I like CL-WHO for outputting HTML, but I'm not trying out BKNR.IMPEX - it outputs to XML well (automatically, once you create a DTD). I don't think it will do tables well, but for that I wrote a custom function very quickly
<lisp123>
now*
<lisp123>
In general, I'm trying to store objects now in classes, and then have a defgeneric / defmethod to define a "print-html" method for each object - thus creating HTML files is just printing the objects
<lisp123>
I think that's the best approach IMO
<susam>
lisp123: Thanks!
<lisp123>
also check out HTML-TEMPLATE - it's a great solution to allow designers to work on HTML and then have lisp populate it.
heisig has joined #commonlisp
varjag has quit [Ping timeout: 252 seconds]
frgo has joined #commonlisp
frgo has quit [Remote host closed the connection]
hendursaga has joined #commonlisp
wilfred has quit [Quit: Connection closed for inactivity]
<splittist>
I use djula as a templating solution. Not that anyone should take web lessons from me.
elf_fortrez has quit [Ping timeout: 246 seconds]
prxq_ is now known as prxq
elf_fortrez has joined #commonlisp
frgo has joined #commonlisp
lisp123 has quit [Remote host closed the connection]
lisp123 has joined #commonlisp
lisp123 has quit [Ping timeout: 272 seconds]
frgo has quit [Remote host closed the connection]
kakuhen has quit [Quit: Leaving...]
lisp123 has joined #commonlisp
davep has quit [Quit: Connection closed for inactivity]
asdf-uio` has joined #commonlisp
asdf-uiop has quit [Read error: Connection reset by peer]
lisp123 has quit [Ping timeout: 265 seconds]
IAmRasputin has joined #commonlisp
elf_fortrez has quit [Ping timeout: 246 seconds]
lisp123 has joined #commonlisp
IAmRasputin has quit [Ping timeout: 268 seconds]
<coat>
I am trying to load a file from current directory but I get error that the file does not exist. issue only in slime. works fine in shell.
<lisp123>
what's your code
<susam>
coat: Check *default-pathname-defaults* . Perhaps it is pointing to some directory other than the one you think is the current directory?
<coat>
susam: thanks. it is pointing to a different directory. i thought it would be automatically set to the directory of my current .lisp file.
<Josh_2>
well that shortens the loop, but I mean can I do it with format
<gabc>
(I don't know format much tho sorry)
frgo has quit [Ping timeout: 250 seconds]
unyu has quit [Quit: WeeChat 3.2]
yitzi has joined #commonlisp
amb007 has quit [Ping timeout: 265 seconds]
<Josh_2>
I'm trying to represent a tree of products, their subproducts and varying lengths of time and prices for each product
<Josh_2>
with product A having two sub products A.b and A.c with A.b and A.c having the same number of months but varying prices on each
amb007 has joined #commonlisp
amb007 has quit [Read error: Connection reset by peer]
<Josh_2>
I've been having a hard time finding a nice way to do this
amb007 has joined #commonlisp
<char>
I will try to help you, but also consider #clschool
<Josh_2>
what
<Josh_2>
is my question so plebish that I should ask it in #clschool :(
<char>
I'm not being demeaning; it is just a consideration.
<char>
can A.b have subproducts?
<shka>
eh
<shka>
Josh_2: you wanna do this in memory or in the database?
<Josh_2>
memory
<shka>
right
<shka>
so here is what i suggest you to do
<Josh_2>
char: yes, that was my thinking, this is why I've been stuck
<shka>
define class for representation of product snapshot in time
<shka>
for instance, in June
<shka>
slap slots with time brackets on it
<shka>
then, define class called product-timeline or something
<shka>
which will group all time version of the particular product in order, so you can binary search (or something) given the date
<shka>
all product-timelines, holding product-snapshot can be placed in a hashtable
<shka>
mapping product name to the product-timeline
<shka>
sub-products can be represented as a list of product names in each product
<shka>
next, you gonna want something to map the name of the product to the product, given the time domain
<shka>
and i think that this is it
<shka>
this way you can have varying subproducts in each month even
<Josh_2>
Yes that seems like a highly extensible way of doing it
<shka>
alternative solution is to have another hash-table mapping product-name to subproducts
<shka>
but this will be good only if products never gets or looses another subproduct
<shka>
regardless: remember that the special variables can be very helpful at times
<shka>
hope that this helps!
<Josh_2>
I think I may not have been clear enough, when I say months I mean say you can get the product for X months, and the X is adjustable with different prices say 1, 2, 3, 6, forever, etc with each seller being able to change the number of months and their prices
tyson2 has quit [Remote host closed the connection]
<shka>
Josh_2: yes, that's why you gonna need two slots to bracket the time period
tyson2 has joined #commonlisp
blihp has joined #commonlisp
clos-encounters has quit [Ping timeout: 252 seconds]
<Josh_2>
I will try this approach but using lists instead of hash tables
ad-absurdum has quit [Quit: Leaving]
selwyn_ has joined #commonlisp
selwyn has quit [Ping timeout: 250 seconds]
lisp123 has quit [Remote host closed the connection]
lisp123 has joined #commonlisp
trocado has quit [Ping timeout: 272 seconds]
lisp123 has quit [Ping timeout: 244 seconds]
tyson2 has quit [Ping timeout: 258 seconds]
CrashTestDummy2 has joined #commonlisp
<Josh_2>
shka: got this so far, I think it will work https://plaster.tymoon.eu/view/2513#2513 each user will have their own product tree which they can modify as they wish, taking away and adding
<Josh_2>
this is just the class structure ofc
<Josh_2>
Thank you for helping me, feels like you sprayed a bit of WD40 on my brain, lubricating it a bit
<char>
also might consider using structs. I'm not certain myself when to use struct vs class
CrashTestDummy3 has quit [Ping timeout: 268 seconds]
<Josh_2>
When you want to go fast
selwyn_ has quit [Read error: Connection reset by peer]
<beach>
You should avoid structs unless performance measures indicate that they would have a certain advantage to standard classes.
<shka>
structs are annoying to use
<shka>
all those redefinitions
<char>
It is hard to get simpler than that, thanks beach
<beach>
shka: Exactly.
<shka>
but you can inline slot access... which is sometimes important
<shka>
but beach got it right
<shka>
don't waste your time with structs until you have to
<beach>
Also, we keep inventing new techniques, like call-site optimization, that make it possible to inline slot accessors of standard objects in many cases. It would be silly to dumb down your programming style for reasons that may go away in the future.
<beach>
Same thing with generic functions. It would be silly to avoid generic functions in favor of ordinary functions if we can make generic dispatch as fast as ordinary function calls in many cases.
lisp123 has joined #commonlisp
<beach>
Same thing with keyword arguments.
<shka>
keyword arguments are way to useful to not use even despite theoretical performance hit
<shka>
and there is also INLINE
<shka>
i've been programming in golang lately, lack of optional/named arguments lead to some intriguing oddities in the language
<shka>
for instance there is os.Open, but also os.OpenFile
<shka>
which may rise some eyebrows
<beach>
Oh, just wait for the new version of the language. I presume it is like every other language in that the specification changes every year or so.
<pjb>
Josh_2: but if you want to filter the list while printing, you will have to write a format function and use it with (format nil "~{~/fmt-only-even/~^, ~}" '(1 2 3 4 5))
frgo has joined #commonlisp
char has quit [Ping timeout: 272 seconds]
char has joined #commonlisp
tyson2 has joined #commonlisp
frgo has quit [Ping timeout: 272 seconds]
trn has quit [Ping timeout: 272 seconds]
tyson2 has quit [Remote host closed the connection]
<jcowan>
That remark about Common Lisp "obarrays" should be about Lisp 1.5 or Maclisp.
tyson2 has joined #commonlisp
CrashTestDummy3 has joined #commonlisp
Lycurgus has quit [Quit: Exeunt]
CrashTestDummy2 has quit [Ping timeout: 265 seconds]
makomo has joined #commonlisp
selwyn has joined #commonlisp
yitzi has quit [Quit: Leaving]
bhaible has quit [Remote host closed the connection]
bhaible has joined #commonlisp
lisp123 has joined #commonlisp
IAmRasputin has joined #commonlisp
bhaible has quit [Remote host closed the connection]
bhaible has joined #commonlisp
lisp123 has quit [Ping timeout: 265 seconds]
IAmRasputin has quit [Ping timeout: 252 seconds]
Bike has joined #commonlisp
peterhil has quit [Quit: Must not waste too much time here...]
peterhil has joined #commonlisp
frgo has joined #commonlisp
frgo_ has joined #commonlisp
Bike has quit [Quit: Client closed]
frgo has quit [Ping timeout: 250 seconds]
selwyn has quit [Read error: Connection reset by peer]
Nilby has quit [Ping timeout: 244 seconds]
frgo_ has quit [Read error: Connection reset by peer]
frgo has joined #commonlisp
lad has joined #commonlisp
lisp123 has joined #commonlisp
dsk has quit [Ping timeout: 240 seconds]
lisp123 has quit [Ping timeout: 250 seconds]
lisp123 has joined #commonlisp
heisig has quit [Quit: Leaving]
char has quit [Ping timeout: 258 seconds]
treflip has quit [Remote host closed the connection]
shka has quit [Ping timeout: 244 seconds]
aleamb has quit [Ping timeout: 272 seconds]
char has joined #commonlisp
akoana has joined #commonlisp
<Josh_2>
Thanks pjb
Inline has quit [Remote host closed the connection]
Inline has joined #commonlisp
Inline has quit [Remote host closed the connection]
cage has quit [Quit: rcirc on GNU Emacs 27.1]
Inline has joined #commonlisp
Inline has quit [Remote host closed the connection]
Inline_ has joined #commonlisp
Inline_ has quit [Remote host closed the connection]
Inline has joined #commonlisp
kakuhen has joined #commonlisp
lad_ has joined #commonlisp
lad has quit [Read error: Connection reset by peer]
lisp123 has quit [Remote host closed the connection]
lisp123 has joined #commonlisp
gigamonkey has quit [Remote host closed the connection]
lisp123 has quit [Ping timeout: 265 seconds]
gigamonkey has joined #commonlisp
trocado has joined #commonlisp
selwyn has joined #commonlisp
CrashTestDummy2 has joined #commonlisp
gigamonk` has joined #commonlisp
CrashTestDummy3 has quit [Ping timeout: 252 seconds]
gigamonkey has quit [Ping timeout: 265 seconds]
lisp123 has joined #commonlisp
utis has joined #commonlisp
char has quit [Ping timeout: 244 seconds]
lisp123 has quit [Ping timeout: 244 seconds]
char has joined #commonlisp
IAmRasputin has joined #commonlisp
IAmRasputin has quit [Ping timeout: 265 seconds]
aleamb has joined #commonlisp
derelict has quit [Quit: WeeChat 3.2]
frgo has quit [Remote host closed the connection]
frgo has joined #commonlisp
[deleted] has joined #commonlisp
amb007 has quit [Ping timeout: 265 seconds]
livoreno has quit [Ping timeout: 244 seconds]
amb007 has joined #commonlisp
lisp123 has joined #commonlisp
sjl has quit [Quit: WeeChat 2.2-dev]
lisp123 has quit [Ping timeout: 252 seconds]
lisp123 has joined #commonlisp
lisp123 has quit [Remote host closed the connection]
eta has quit [Ping timeout: 244 seconds]
varjag has quit [Ping timeout: 268 seconds]
lisp123 has joined #commonlisp
eta has joined #commonlisp
pve has quit [Quit: leaving]
char has quit [Ping timeout: 244 seconds]
lisp123 has quit [Ping timeout: 250 seconds]
bhaible has quit [Remote host closed the connection]
bhaible has joined #commonlisp
makomo has quit [Quit: WeeChat 3.0.1]
bhaible has quit [Remote host closed the connection]
bhaible has joined #commonlisp
bhaible has quit [Remote host closed the connection]
bhaible has joined #commonlisp
gigamonk` has quit [Remote host closed the connection]
gigamonk` has joined #commonlisp
lisp123 has joined #commonlisp
selwyn has quit [Read error: Connection reset by peer]
lisp123 has quit [Ping timeout: 265 seconds]
bhaible has quit [Remote host closed the connection]
bhaible has joined #commonlisp
klltkr_ has quit [Read error: Connection reset by peer]