<z3t0>
I tried searching but only found information on numbers
<pjb>
Some implementations accept ~D to left pad strings, but it's not standard. To pad on the left, you can write (let ((s "Hello")) (format nil "~VA~A" (- 10 (length s)) "" s)) #| --> " Hello" |#
<pjb>
If you have to do a lot of padding of different kind, with different padding characters, etc, you can write your own formatter function and call it with ~/
<z3t0>
Looking at the hyperspec, which operator is that going tobe?
<equwal>
Your editor should have a function to lookup format specs
vap1 has joined #lisp
<equwal>
C-c C-d ~ on sl(y/imed)
vaporatorius has quit [Ping timeout: 268 seconds]
khisanth_ has quit [Ping timeout: 276 seconds]
sjl has quit [Ping timeout: 240 seconds]
oni-on-ion has quit [Ping timeout: 240 seconds]
synaps3 has quit [Quit: Leaving]
buffergn0me has joined #lisp
xkapastel has quit [Quit: Connection closed for inactivity]
khisanth_ has joined #lisp
bitmapper has quit [Ping timeout: 240 seconds]
luhuaei has joined #lisp
mindthelion has joined #lisp
quazimodo has quit [Read error: Connection reset by peer]
techquila has quit [Ping timeout: 268 seconds]
luhuaei has quit [Remote host closed the connection]
quazimodo has joined #lisp
slyrus__ has quit [Ping timeout: 265 seconds]
enrio has left #lisp ["Leaving"]
stepnem has quit [Ping timeout: 276 seconds]
adip has quit [Ping timeout: 265 seconds]
adip has joined #lisp
semz_ has joined #lisp
semz_ has joined #lisp
semz_ has quit [Changing host]
stepnem has joined #lisp
semz has quit [Ping timeout: 268 seconds]
akoana has left #lisp ["Leaving"]
renzhi has quit [Ping timeout: 265 seconds]
Oladon has quit [Quit: Leaving.]
davepdotorg has joined #lisp
davepdotorg has quit [Ping timeout: 240 seconds]
icov0x29a has quit [Quit: Leaving]
notzmv has joined #lisp
shifty has joined #lisp
montxero has quit [Ping timeout: 276 seconds]
gxt_ has joined #lisp
buffergn0me has quit [Ping timeout: 245 seconds]
gxt has quit [Ping timeout: 260 seconds]
buffergn0me has joined #lisp
gravicappa has joined #lisp
slyrus has joined #lisp
kirkwood has quit [Remote host closed the connection]
Bike has quit [Quit: Lost terminal]
nthian has joined #lisp
Nomenclatura has joined #lisp
orivej has quit [Ping timeout: 268 seconds]
<beach>
Good morning everyone!
<equwal>
good morning beach.
<equwal>
What do you think about using CL for scripting?
<LdBeth>
Hello beach
<equwal>
It seems to be lacking in basic utilities for that...although roswell definitely is a good start.
<beach>
I learned that there are two meanings for "scripting". 1. An extension language for an application written in a static language. 2. A language for manipulating simple text files from the shell.
<equwal>
I was thinking of the second one
<LdBeth>
For the later one, REXX is a great language for that
<equwal>
(like bash)
<equwal>
for the other one I would also avoid CL and probably use fennel with lua.
<LdBeth>
I find even scheme shell not easy to write
<beach>
For the first one, it should be avoided entirely, and the application should be written in Common Lisp to begin with.
<LdBeth>
And use safe eval technique for user extensibility
<LdBeth>
It’s usually hard if only mocking the practice of applications written in other languages
superkumasan has quit [Ping timeout: 265 seconds]
frgo has joined #lisp
torbo has quit [Remote host closed the connection]
superkumasan has joined #lisp
dddddd has quit [Remote host closed the connection]
adip has quit [Ping timeout: 265 seconds]
buffergn0me has quit [Ping timeout: 245 seconds]
<beach>
LdBeth: Not sure what you mean.
Nomenclatura has quit [Quit: q]
<beach>
What I mean is this: Often the choice is made to write the application in a language with a compiler that "is known to produce fast code". Typically, this means C++.
<beach>
Then, already, the application is going to be slow because of the steps you have to take to compensate for the manual memory management.
<beach>
But then, because a static language is used, a dynamic language is chosen for the extensions.
<beach>
Again, typically, an implementation in the form of an interpreter is chosen for the extension language.
<beach>
So now you have a combination of 1. A slow application. 2. An even slower extension-language evaluator. 3. A debugging nightmare because of the combination.
ravenousmoose has joined #lisp
<beach>
But I am preaching to the choir here.
vlatkoB has joined #lisp
ravenousmoose has quit [Ping timeout: 246 seconds]
<Josh_2>
beach: What do you mean that C++ applications end up slow because of memory management?
<no-defun-allowed>
Guessing object lifetimes is very very hard, so the "solution" is to copy everything when you're not sure, from what I've heard about C++.
<LdBeth>
I believe some statistics has shown that most of the time GC outperforms manual men management
<no-defun-allowed>
And malloc/free is much slower than a compacting garbage collector when collection doesn't have to be done.
<beach>
Josh_2: I mean, in order to make the application modular, either objects are copied a lot, or else some smart pointers or reference counting is used. All these techniques are orders of magnitude slower than what Common Lisp does.
<Josh_2>
Oh right
<Josh_2>
neat :D
dale has quit [Quit: My computer has gone to sleep]
Necktwi has joined #lisp
<aeth>
you can also fragment the heap if you don't use garbage collection
<LdBeth>
beach: I mean in some case a script language is used as an abstraction to prevent user from messing with the internals of the application while retaining the abilities to extend the functionality
<aeth>
Josh_2: let's say you have [AAAAABBBCCCCC...] and you want to free BBB and allocate DDDDD... now you have [AAAAA___CCCCCDDDDD...] and it will only get worse over time unless you're really careful
<beach>
aeth: Fragmentation was an invention by the theoreticians in the 1960s and the theory has been perpetuated over the years, despite the fact that Paul Wilson showed that it is not a problem in practice. And that was some 20 years ago now.
<LdBeth>
It’s like DSL
<beach>
LdBeth: I see, so how do they prevent the use of GDB?
<aeth>
beach: well i was about to say that the other unless is unless you use a GC that handles it for you
<beach>
aeth: Everybody should read the excellent paper by Wilson et all. It shows that only artificial applications create fragmentation. Not real ones.
<Josh_2>
What paper is that?
<beach>
The "allocator survey". Let me find it for you...
<aeth>
LdBeth: embedded scripting languages afaik have three uses: (1) friendlier language, (2) interpreted or fast compiling vs. really, really slow compiling so it's an easier to iterate in language, and (3) sandboxing
<no-defun-allowed>
aeth: Well, you could just put objects of similar sizes in the same pages to avoid some fragmentation. Parallel to that, and which I think is more important, is that allocation is bumping a pointer.
<aeth>
beach: that's news to me
<beach>
aeth: Yes, and sadly to many others too.
<beach>
Dynamic Storage Allocation: A Survey and Critical Review. There are PDFs available everywhere.
<beach>
Section 2.3 What Fragmentation Really Is, and Why the Traditional Approach is Unsound.
ebzzry has quit [Ping timeout: 265 seconds]
brettgilio has quit [Quit: Quit]
theruran has joined #lisp
brettgilio has joined #lisp
<aeth>
beach: I do agree with you on your earlier point on scripting languages, though. I think 100% of a program in a fast language can be faster than 60% in a very fast language and 40% in a (possibly very) slow language
<aeth>
s/fast language/fast language implementation/
<beach>
Fragmentation has been shown to occur for all memory-allocation techniques, but the research then uses a model of program behavior that is a lousy approximation of reality, namely some statistical model such as random allocation/deallocation or first-order Markov model.
<beach>
aeth: Exactly.
<aeth>
Especially since there's almost always some penalty to FFIing
<aeth>
This really just leaves afaik (1) "more approachable", (2) cuts down on compilation waiting (but some CLs do this by having an interpreter and a compiler), and (3) sandboxing
<aeth>
I don't think #2 really applies to CL that much, especially given the typical development pattern. You'd have to have some situation where you'd need to constantly recompile ironclad to really suffer in compilation times
sauvin has joined #lisp
ravenousmoose has joined #lisp
shka_ has joined #lisp
Necktwi has quit [Ping timeout: 240 seconds]
<beach>
aeth: I am not sure what your itemized list represents. Advantages to using a static language? Objections to using Common Lisp? Something else?
jackdaniel has joined #lisp
vlatkoB has quit [Remote host closed the connection]
Fare has quit [Ping timeout: 240 seconds]
vlatkoB has joined #lisp
shifty has quit [Ping timeout: 250 seconds]
shifty has joined #lisp
montxero has joined #lisp
<aeth>
beach: Justifications for using a scripting language in a large application
frgo has quit [Remote host closed the connection]
zaquest has quit [Ping timeout: 240 seconds]
<beach>
Oh!
<beach>
Again, for sandboxing, how do they prevent the user from executing the application from GDB and altering any memory location that way?
<aeth>
beach: I believe sandboxing is used when you have an application that downloads scripts over the Internet, such as games or the web
shifty has quit [Ping timeout: 252 seconds]
<beach>
I see.
<aeth>
So the user isn't the author of the script
shifty has joined #lisp
<beach>
With first-class global environments, it would be easy to do in Common Lisp as well, and in fact, that is one important use for them.
<aeth>
Ideally you'd do something like embed a DSL that has no access to file operations unless whitelisted or through a strict API
<aeth>
(e.g. for games, loading a save might still be valid)
makomo has joined #lisp
<beach>
Ideally, the Common Lisp implementation used for the application would already have native first-class global environments, but even if it doesn't it is no harder (probably easier) to provide a subset of Common Lisp accessible for extensions, than it is to include an entire compiler or interpreter for a dynamic scripting language into an application written in a static language.
<beach>
I mean, SBCL does not have first-class global environments, but I can run SICL code inside SBCL in a first-class global environment that does not have access to the SBCL code itself.
<beach>
It would be a bit twisted to use my technique for scripting an application for the purpose of sandboxing, but it is possible.
zaquest has joined #lisp
<aeth>
interesting
<aeth>
Oh, I brought up games and the web as examples earlier, but it seems like practically everything has a package manager these days
Necktwi has joined #lisp
JohnMS_WORK has joined #lisp
JohnMS has joined #lisp
JohnMS has quit [Client Quit]
JohnMS_WORK has quit [Read error: Connection reset by peer]
matijja has joined #lisp
JohnMS_WORK has joined #lisp
scymtym has quit [Ping timeout: 240 seconds]
vlatkoB has quit [Ping timeout: 252 seconds]
enrio has joined #lisp
flamebeard has joined #lisp
enrioog has joined #lisp
nanoz has joined #lisp
zaquest has quit [Ping timeout: 268 seconds]
enrio has quit [Ping timeout: 240 seconds]
zaquest has joined #lisp
enrioog has quit [Ping timeout: 268 seconds]
vlatkoB has joined #lisp
enrio has joined #lisp
z0d has quit [Ping timeout: 276 seconds]
enrioog has joined #lisp
nanoz has quit [Ping timeout: 240 seconds]
enrio has quit [Ping timeout: 276 seconds]
enrioog has quit [Ping timeout: 276 seconds]
jfb4_ has joined #lisp
jfb4 has quit [Ping timeout: 245 seconds]
aeth has quit [Ping timeout: 240 seconds]
jfb4 has joined #lisp
jfb4_ has quit [Ping timeout: 250 seconds]
frgo has joined #lisp
Necktwi has quit [Ping timeout: 240 seconds]
aeth has joined #lisp
superkumasan has quit [Ping timeout: 268 seconds]
superkumasan has joined #lisp
heisig has joined #lisp
enrio has joined #lisp
rgherdt has joined #lisp
scymtym has joined #lisp
enrioog has joined #lisp
enrio has quit [Ping timeout: 268 seconds]
stepnem has quit [Quit: ZNC 1.7.2+deb3 - https://znc.in]
stepnem has joined #lisp
grabarz has joined #lisp
quazimodo has quit [Ping timeout: 265 seconds]
enrio has joined #lisp
enrioog has quit [Ping timeout: 240 seconds]
enrioog has joined #lisp
Josh_2 has quit [Ping timeout: 268 seconds]
enrio has quit [Ping timeout: 240 seconds]
davepdotorg has joined #lisp
enrioog has quit [Ping timeout: 240 seconds]
grabarz has quit [Ping timeout: 240 seconds]
enrio has joined #lisp
davepdotorg has quit [Ping timeout: 240 seconds]
grabarz has joined #lisp
Krystof has quit [Ping timeout: 240 seconds]
enrio has quit [Read error: Connection reset by peer]
enrio has joined #lisp
adip has joined #lisp
davepdotorg has joined #lisp
enrioog has joined #lisp
enrio has quit [Ping timeout: 268 seconds]
enrioog has quit [Ping timeout: 268 seconds]
enrio has joined #lisp
enrio has quit [Read error: Connection reset by peer]
enrio has joined #lisp
shka__ has joined #lisp
enrioog has joined #lisp
montxero has quit [Ping timeout: 252 seconds]
enrio has quit [Ping timeout: 250 seconds]
jonatack has quit [Ping timeout: 245 seconds]
enrioog has quit [Ping timeout: 240 seconds]
Krystof has joined #lisp
enrio has joined #lisp
Cymew has joined #lisp
Cymew has quit [Read error: Connection reset by peer]
Cymew has joined #lisp
ljavorsk has joined #lisp
hhdave has joined #lisp
enrioog has joined #lisp
enrio has quit [Ping timeout: 268 seconds]
__jrjsmrtn__ has quit [Quit: Bye !]
enrioog has quit [Read error: Connection reset by peer]
montxero has joined #lisp
adip has quit [Ping timeout: 276 seconds]
__jrjsmrtn__ has joined #lisp
adip has joined #lisp
ralt has joined #lisp
kaun_ has joined #lisp
kaun_ has quit [Quit: Erc off!]
zooey has quit [Remote host closed the connection]
gxt_ has quit [Remote host closed the connection]
gxt_ has joined #lisp
zooey has joined #lisp
grabarz has quit [Ping timeout: 240 seconds]
adip has quit [Ping timeout: 240 seconds]
grabarz has joined #lisp
jonatack has joined #lisp
<equwal>
/msg *shell ~/logchan.fish \#lisp
<equwal>
/msg *shell ~/logchan.fish \#lisp
patrixl has quit [Quit: Leaving.]
patrixl has joined #lisp
montxero has quit [Ping timeout: 252 seconds]
rgherdt has quit [Quit: Leaving]
Bourne has joined #lisp
shifty has quit [Ping timeout: 240 seconds]
z0d has joined #lisp
atgreen__ has joined #lisp
shka_ has quit [Ping timeout: 268 seconds]
shka_ has joined #lisp
atgreen_ has quit [Ping timeout: 268 seconds]
clothespin has quit [Ping timeout: 252 seconds]
Lycurgus has joined #lisp
jmercouris has joined #lisp
phadthai has quit [Quit: brb]
<jmercouris>
I have the following: (defparameter x (lambda (x) (print x)))
<jmercouris>
how can I make it so that I can do (y "lol") and have it call my lambda?
<jmercouris>
would I have to wrap my lambda in a defun?
<jmercouris>
is there a make-function or something?
phadthai has joined #lisp
pfdietz has quit [Ping timeout: 260 seconds]
<jmercouris>
can I setf symbol-function?
<jmercouris>
wow, apparently I can
<jmercouris>
(setf (symbol-function 'y) x)
<jmercouris>
the spec is so large, does anyone know all of it?
atgreen__ has quit [Ping timeout: 265 seconds]
<ralt>
the typical way is (funcall x "bar")
<jmercouris>
Yeah, I know, I was just wondering that specifically