<aeth> (And no one is going to do your homework for you, so you'd have to add the time it would take to learn Lisp.)
LiamH has quit [Quit: Leaving.]
<whoman> good thing advice is free
wigust- has quit [Ping timeout: 240 seconds]
megachombas has quit [Ping timeout: 260 seconds]
<pjb> aeth: for a student, yes. I would do it in a day, I already done it several times, including an assembler, a disassembler, etc.
<loli> was apply not there?
<aeth> pjb: I would estimate 3 days for someone doing it the first time, student or not. Obviously doing something more than once makes you write it a lot faster. Sorry, I could have been clearer.
<aeth> A minimum of two calendar days because sometimes you get to a point where you get stuck and only sleep can solve things.
damke_ has joined #lisp
<whoman> hows your project going aeth
<aeth> whoman: which one?
dddddd has quit [Remote host closed the connection]
<whoman> whichever one is going
shrdlu68 has quit [Ping timeout: 268 seconds]
damke has quit [Ping timeout: 264 seconds]
<aeth> Slow progress on everything. I've been sick, and it was really bad on Monday.
<whoman> i am sorry to hear,i hope your health and quality of life returns to normal and/or improves
<aeth> thanks
Amplituhedron has joined #lisp
<drmeister> Is there a lisp function that waits for the user to hit enter or a key - something that will work in slime.
<drmeister> I guess y-or-n-p
attila_lendvai has joined #lisp
<drmeister> Hmm, it causes my slime to freak out.
<whoman> read ?
<whoman> *standard-input* ?
attila_lendvai has quit [Client Quit]
<drmeister> No - it's ok.
<drmeister> I wasn't sure if it would block and respond properly.
dented42_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Pixel_Outlaw has joined #lisp
markong has quit [Ping timeout: 256 seconds]
wigust has joined #lisp
smurfrobot has joined #lisp
pagnol has joined #lisp
pagnol has quit [Ping timeout: 240 seconds]
Kaisyu has joined #lisp
Cymew has joined #lisp
fikka has quit [Ping timeout: 240 seconds]
Cymew has quit [Ping timeout: 260 seconds]
iqubic` has joined #lisp
iqubic` is now known as iqubic
iqubic has quit [Client Quit]
iqubic has joined #lisp
wigust has quit [Ping timeout: 252 seconds]
FreeBirdLjj has joined #lisp
damke has joined #lisp
fikka has joined #lisp
pagnol has joined #lisp
pagnol has quit [Read error: Connection reset by peer]
damke_ has quit [Ping timeout: 264 seconds]
fikka has quit [Ping timeout: 268 seconds]
bgardner has joined #lisp
AxelAlex has joined #lisp
Cymew has joined #lisp
damke_ has joined #lisp
Cymew has quit [Ping timeout: 256 seconds]
damke has quit [Ping timeout: 264 seconds]
randomstrangerb has quit [Ping timeout: 240 seconds]
randomstrangerb has joined #lisp
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #lisp
drcode has quit [Ping timeout: 248 seconds]
FreeBirdLjj has quit [Ping timeout: 240 seconds]
pierpa has quit [Quit: Page closed]
fikka has joined #lisp
muyinliu has quit [Quit: Textual IRC Client: www.textualapp.com]
manualcrank has joined #lisp
jfb4 has quit [Ping timeout: 256 seconds]
pransninja has joined #lisp
jfb4 has joined #lisp
<pransninja> True to form, the Chapter 13 of PCL took me as long as every other chapter before it, the chapter title: Beyond Lists: Other Uses for Cons Cells
<pransninja> So lisp is basically a language for cons cells processing.
fikka has quit [Ping timeout: 240 seconds]
<pransninja> Shoulda call it consp. lol
<pransninja> Also
<pransninja> is there any package for ascii printing datatypes?
<aeth> Lisp has multidimensional arrays, hash-tables, and other things that aren't cons cells.
<pransninja> I thought hash tables are just plist?
<pransninja> no?
<iqubic> /join #git
<iqubic>
<pransninja> or does lisp has real hashtables?
<pransninja> iqubic: you dun goffed, git.
<aeth> Modern Lisp is as much about LISt Processing as a Swiss army knife is a knife.
<pransninja> aeth: That is not a yes or no answer, I am confused.
<aeth> Syntactically, everything's cons cells. The actual data structures that you create are not, though.
<|3b|> CL has 'real' hash tables, vectors, arrays, etc
<aeth> closures, hash tables, multidimensional arrays, structs, standard-objects, etc., couldn't be efficiently implemented with cons cells.
<aeth> (vectors in Lisp are just multidimensional arrays of dimension 1)
<pransninja> isn't that what vectors are, anyways?
warweasle has joined #lisp
<aeth> vectors (including strings) will have an O(1) length and an O(1) elt (or aref). lists will have an O(n) length and an O(n) elt (or nth)
<aeth> Vectors have different performance characteristics. And even if they're expressed as lists in source code, they will (usually) be turned into vectors at compile time.
terpri has quit [Quit: Leaving]
terpri has joined #lisp
arescorpio has joined #lisp
whoman has quit [Remote host closed the connection]
whoman has joined #lisp
iqubic` has joined #lisp
<aeth> CL's hash-tables have a different performance trade-off than plists or alists. In theory, plists might be faster for very short things, but hash-tables will win for large data sets.
dtornabene has joined #lisp
igemnace has joined #lisp
iqubic has quit [Ping timeout: 252 seconds]
fikka has joined #lisp
<pjb> Last time I benchmarked, for implementations compiling to native code the break-even point was about 5 entries (<= 5 entries, a-list or p-list are faster; >5 entries, hash-tables are faster), and for byte-interpreted implementations such as clisp, the break-even point is more like 35 entires!
<pjb> One should note also that the space overhead of hash-tables is way over lists!
<pransninja> aeth: So is the implementation of hashtables part of the standard?
<pransninja> Should I expect standard complaint compilers to make the same perf trade-offs?
<pjb> If you can bound the number of elements, to a small number, it may be even better to use a vector than a hash-table.
<aeth> pransninja: You can't expect all implementations to behave exactly the same because maybe one day someone will finish JSCL or write a popular JIT bytecode CL.
<aeth> pransninja: But hash tables are in the standard, as are vectors. And a lot of the same optimizations apply to all of the current major implementations.
<pransninja> aeth: But does the standard make any recommendations?
<aeth> e.g. unless you're using clisp, you can pretty much assume that you can make single-float and double-float specialized arrays.
<pransninja> similar to recycling nature of some functions.
fikka has quit [Ping timeout: 252 seconds]
<aeth> That's what the standard says about hash tables (or at least one entry point into what it says)
<pransninja> I can barely make sense of hyperspec.
<pransninja> it is rubbish, imho.
<pransninja> just randomly indent text thrown on the screen
<pransninja> as if typesetting wasn't invented yet
<aeth> Actually finding the highest performance thing is tricky.
turkja has joined #lisp
<aeth> Vectors will win more often than you think when numbers are involved because they can be specialized
zacts has quit [Quit: WeeChat 1.9.1]
<aeth> i.e. you can have a vector of double-floats or a vector of (unsigned-byte 32)s
zacts has joined #lisp
iqubic` is now known as iqubic
<aeth> There aren't any typed lists or typed hash tables (well, they all store type T), so vectors often give more information to the compiler
<pransninja> That is good to know.
<pransninja> Any good material on benchmarking and optimizations in lips?
<aeth> Most information is probably specific to SBCL (and/or CMUCL), but a good deal of that will also apply to CCL and possibly even ECL.
<aeth> Optimizing CLISP in its current state is imo hopeless.
<aeth> s/Optimizing CLISP/Optimizing for CLISP/
shrdlu68 has joined #lisp
<pransninja> That makes me sad.
whoman has quit [Remote host closed the connection]
<aeth> Most optimizations are imo a waste of time. Generally you want to (declare (optimize (speed 3))) and declare any types that are numeric or arrays (if you can provide length information for the array type, that can really help because the compiler may replace repeated bounds checking with one type check at the beginning of the function)
whoman has joined #lisp
<aeth> SBCL will give you optimization notes when compiling when speed is 3.
<aeth> If everything is of the same numeric type, you can use :element-type in make-array, e.g. (make-array 3 :element-type 'single-float :initial-element 0f0) or (make-array '(2 2) :element-type 'double-float :initial-contents '((0d0 0d0) (0d0 0d0)))
<aeth> If things aren't of the same type but are numbers or arrays, typed slots in a struct (defined with defstruct) might work
<aeth> If something is trivial and probably never going to change, inlining can help the compiler. Above the function you can do this: (declaim (inline the-function-name-goes-here))
<aeth> And that's about it.
<aeth> Not every implementation will use all of the optimization information you give it, e.g. CLISP doens't have single-float or double-float specialized arrays, and just makes them T arrays. I think almost every implementation does accept single-float, double-float and a large number of integer types (e.g. (unsigned-byte 8) and (unsigned-byte 32))
<aeth> Only character and bit are required by the specification, but (unsigned-byte 8) is heavily assumed by many libraries.
<pjb> aeth: on the other hand, clisp has short-float that will fit immedately into arrays of T!
<pjb> also it has long-float to provide more precision!
<pjb> clisp has unique features not found in other implementations!
<pransninja> i like visibility into perf.
<aeth> pjb: The arbitrary-precision long float is the one reason to use CLISP for code that deals with numbers, afaik.
<pransninja> I don't mind when things get optimized, but I don't like when it does not.
<pransninja> in short, I like predictability.
<aeth> pjb: It is a useful feature when you need it
<pransninja> I want to be able to reason about my programs perfs.
deng_cn has joined #lisp
<pjb> pransninja: you can reason with clisp, you just need to know what CL functions are implemented in C and what are implemented in lisp!
<pjb> If you write your function to process your data with CL functions implemented in C, then it'll be fast. If you do it in lisp, it'll be slower.
fikka has joined #lisp
<pjb> Indead of writing a loop, use reduce or mapcar!
lonjil has quit [Read error: Connection reset by peer]
<pjb> So what's funny is that basically you must adopt a style opposite to what you'd do in sbcl to write efficient code in clisp :-)
<aeth> pransninja: For advanced optimizations, you might be interested in specialization-store. https://github.com/markcox80/specialization-store/
<aeth> pjb: yeah
igemnace has quit [Read error: Connection reset by peer]
<pransninja> at this point, I would like to learn the basics of how you go about optimizations in lisp
igemnace has joined #lisp
<pransninja> The point about find the C function is nice, thanks pjb.
<pransninja> Though, the fact that optimizations depends on the compiler, which is fair, but still, makes it hard.
<pjb> pransninja: it goes like this: you write code that works, without having to deal with memory management or array overflow, because this is controled by the implementation. Once you have something that works, since you've spent 1/10 the time you'd have spent in C, you are left with 9/10 of the time to think about better algorithms. So you can implement them and obtain faster results.
fikka has quit [Ping timeout: 240 seconds]
<pransninja> pjb: Oh, like I have said before, C is a shameful benchmark of language design.
Oladon has joined #lisp
<pransninja> So anything that compares safety or productivity with C is meaningless to me.
<pransninja> But I do like the idea of write then optimize.
<pransninja> However, the question is, how does one optimizes?
<pjb> pransninja: as I said, using O(nlogn) algorithms instead of O(n^2) algorithms.
<pjb> Using O(n) algorithms instead of O(nlogn).
<pransninja> I don't even know how to benchmark meaningfully.
<pjb> Using O(1) algorithms instead of O(n).
<pjb> etc.
<pransninja> I could look into the dissembler output but that is kinda not cool.
<shrdlu68> pransninja: When compiling with slime you get optimization tips (at least using SBCL)
ebzzry_ has joined #lisp
fikka has joined #lisp
<aeth> pransninja: The list I gave is pretty much all you need, except perhaps with the added advice to preallocate things before large loops. Consing (heap allocation) in large loops might hurt performance.
<aeth> CL is not a pure functional programming language. People are fine with using things like setf when it helps performance
<Pixel_Outlaw> I think it's less /functional/ to mandate a single style at the expense of the programmer's style.
<aeth> Most of the advice is about providing array or number type information to the compiler. That's because functions like + and map are type-generic, but can be inlined by the compiler if the type is known. A lot of type information will be given to the compiler just by the function call. e.g. you can only use car on a cons cell
lonjil has joined #lisp
<aeth> So it isn't really worth it to give other type information, at least afaik
<aeth> Of course, sometimes you might *want* a generic + or map
fikka has quit [Ping timeout: 256 seconds]
<aeth> (Providing the array types can potentially also do two other things: remove bounds checks and tell the compiler the type of the thing that it gets with aref)
arescorpio has quit [Excess Flood]
fikka has joined #lisp
impulse has quit [Ping timeout: 256 seconds]
zulu_inuoe has quit [Read error: Connection reset by peer]
itruslove has joined #lisp
fikka has quit [Ping timeout: 256 seconds]
giraffe has joined #lisp
karswell has joined #lisp
<aeth> pransninja: What are you interested in optimizing, btw? If it's a program that essentially uses no numbers anywhere, almost all of the advice I just gave is worthless.
fikka has joined #lisp
<pransninja> aeth: I know it sounds illogical but I have a fear of slow programs.
<pransninja> I really like to know what my programs does and it will have decent perfs.
<aeth> pransninja: In SBCL, this is how you profile: http://www.sbcl.org/manual/#Profiling
<aeth> pransninja: In other CLs, it's more complicated.
<pransninja> beautiful.
<pransninja> That is what I was expecting.
<pransninja> Thank you aeth.
<pransninja> I am using SBCL so it should be useful.
<aeth> Generally, I optimize on SBCL and hope it works on the other CLs because they just don't expose as much useful information. An almost-complete implementation called Clasp (a C++ and LLVM CL) might, though. And SICL (not anywhere near complete afaik) is designed to be very easy to debug.
<aeth> Only optimize the parts that matter, though. You can spend literally forever getting an extra few percent, and the more specific the optimizations are, the less likely they are to be portable away from SBCL.
zazzerino has joined #lisp
fikka has quit [Ping timeout: 260 seconds]
<aeth> (I think the point where you've gone way too far is probably if your code has implementation-specific optimizations all over the place. And if you're inlining assembly...)
<aeth> (I mean things like e.g. #+sbcl)
bgardner has quit [Quit: Leaving.]
d4ryus1 has joined #lisp
fikka has joined #lisp
damke_ has quit [Ping timeout: 264 seconds]
d4ryus has quit [Ping timeout: 248 seconds]
makomo has quit [Ping timeout: 260 seconds]
damke_ has joined #lisp
pransninja has quit [Ping timeout: 260 seconds]
<ebzzry_> On SBCL, is there a benchmark between vectors and lists?
zazzerino has quit [Remote host closed the connection]
fikka has quit [Ping timeout: 256 seconds]
zazzerino has joined #lisp
<aeth> Afaik, for anything that can be expressed as a specialized array, vectors will win unless you construct those benchmarks carefully to have lists win. Lots of inserting in the middle, maybe?
<ebzzry_> aeth: ok
<aeth> For the best performance with arrays, though, you'll want known length and you'll want an :element-type that actually gets used (not just a T array).
<aeth> An unknown length will bounds check on every single aref iirc
fikka has joined #lisp
<aeth> So the most dramatic wins for vectors over lists would probably be something like 4x4 matrix multiplication.
<aeth> (especially when the matrix has the :element-type defined as single-float or double-float)
fikka has quit [Ping timeout: 240 seconds]
papachan has quit [Ping timeout: 240 seconds]
kolb has quit [Read error: Connection reset by peer]
<aeth> So, afaik, Common Lisp is almost an acceptable FORTRAN now. It looks like it's good enough for Maxima (a CAS program) to use f2cl to compile Fortran to CL. https://github.com/andrejv/maxima/blob/fc2d2c3d0cc532275ac060d46924c26afc667c50/src/numerical/f2cl-lib.lisp
<ebzzry_> aeth: ok
damke has joined #lisp
mrottenkolber has joined #lisp
<ebzzry_> aeth: searching for the existence of an element is generally faster with vectors, right?
mrottenkolber is now known as Guest83322
<aeth> That sounds like something that should (theoretically) work equally well with either sequence type, so benchmark it!
<Bike> more complicated data structures can do that sublinearly.
<aeth> wait
damke_ has quit [Ping timeout: 264 seconds]
<aeth> I probably should ask "Is it sorted?" first
fikka has joined #lisp
<ebzzry_> aeth: Yes, it is sorted.
<aeth> Then vectors will win
<aeth> (But there are probably still better data structures for that)
smurfrobot has quit [Remote host closed the connection]
Tobbi has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<ebzzry_> aeth: what are they?
fikka has quit [Ping timeout: 240 seconds]
muyinliu has joined #lisp
arescorpio has joined #lisp
fikka has joined #lisp
arbv has quit [Ping timeout: 240 seconds]
arbv has joined #lisp
milanj has quit [Quit: This computer has gone to sleep]
fikka has quit [Ping timeout: 248 seconds]
smurfrobot has joined #lisp
<ebzzry_> thanks
smurfrobot has quit [Remote host closed the connection]
brendyn has joined #lisp
smurfrob_ has joined #lisp
randomstrangerb has quit [Ping timeout: 256 seconds]
smurfrob_ has quit [Remote host closed the connection]
randomstrangerb has joined #lisp
smurfrobot has joined #lisp
smurfrobot has quit [Remote host closed the connection]
fikka has joined #lisp
fikka has quit [Ping timeout: 240 seconds]
muyinliu has quit [Quit: Page closed]
khisanth_ has quit [Ping timeout: 256 seconds]
fikka has joined #lisp
damke has quit [Ping timeout: 264 seconds]
damke has joined #lisp
arescorpio has quit [Excess Flood]
damke_ has joined #lisp
jdz has quit [Ping timeout: 256 seconds]
damke has quit [Ping timeout: 264 seconds]
<beach> Good morning everyone!
jdz has joined #lisp
damke has joined #lisp
warweasle has quit [Quit: Leaving]
khisanth_ has joined #lisp
damke__ has joined #lisp
damke_ has quit [Ping timeout: 264 seconds]
damke_ has joined #lisp
damke has quit [Ping timeout: 264 seconds]
<shrdlu68> beach: Good morning!
damke__ has quit [Ping timeout: 264 seconds]
damke_ has quit [Ping timeout: 264 seconds]
damke_ has joined #lisp
Pixel_Outlaw has quit [Quit: Leaving]
warweasle has joined #lisp
smurfrobot has joined #lisp
smurfrobot has quit [Remote host closed the connection]
smurfrobot has joined #lisp
<iqubic> Morning beach.
fikka has quit [Ping timeout: 256 seconds]
ckonstanski has joined #lisp
smurfrobot has quit [Remote host closed the connection]
krwq has joined #lisp
yrdz has joined #lisp
terpri has quit [Ping timeout: 240 seconds]
damke has joined #lisp
damke_ has quit [Ping timeout: 264 seconds]
damke has quit [Ping timeout: 264 seconds]
fikka has joined #lisp
jmercouris has joined #lisp
<jmercouris> good morning everyone
ebzzry_ is now known as ebzzry
<beach> Hello jmercouris.
<jmercouris> beach: I'm finally awake as early as you, only because of jet lag though :P
fikka has quit [Ping timeout: 252 seconds]
<beach> Sorry to hear that.
omilu has quit [Ping timeout: 240 seconds]
zooey has quit [Ping timeout: 255 seconds]
warweasle has quit [Quit: Leaving]
<jmercouris> Yeah, mornings suck :D I very much prefer night
<whoman> forests are contained in seeds
<whoman> or night is very early morning, and morning is very late night
<jmercouris> whoman: "forests are contained in seeds", I feel like there is some profound meaning to this, but I'm not seeing the connection here
pjb has quit [Remote host closed the connection]
<whoman> if morning is the seed for night, how we nurture and water this, will bloom into the night. and vice versa, how night fertilizes the next morning
defaultxr has joined #lisp
<whoman> so you may be having good nights because of bad mornings, but having bad morning times because of good night times ...
pfdietz_ has quit []
<defaultxr> has anyone noticed weird behavior when using quoted lists in tests in fiveam? i.e. if i use '(1 2 3 4 5) in two different tests, and one of the tests modifies its list, it affects the other test. doesn't happen if i use (list 1 2 3 4 5) instead. but it seems like it shouldn't happen at all. didn't happen when i was using prove.
<jmercouris> hmm, that is an interesting thought
zooey has joined #lisp
<jmercouris> defaultxr: Does the behavior persist across implementations?
<defaultxr> i have not tried other implementations.
<defaultxr> only sbcl
schoppenhauer has quit [Ping timeout: 240 seconds]
<defaultxr> i'll try installing another and installing quicklisp on it, etc, if you think that will make a difference
<jmercouris> defaultxr: Are your tests running concurrently?
<jmercouris> Does this behavior manifest itself every time?
<jmercouris> I'm just asking general troubleshooting questions, it sounds a very strange error beacause the quoted list should not share context with another test, and I am thinking it may be some strange bug
dieggsy has joined #lisp
<defaultxr> the tests seem to be running concurrently based on some print statements i added to my code while i was testing
schoppenhauer has joined #lisp
<jmercouris> I also don't know what the difference between '(1 2 3 4 5) and (list 1 2 3 4 5) on an implementation level is
damke has joined #lisp
<jmercouris> maybe there is some strange compiler optimization behavior going on with contexts, that's my best guess
<whoman> there shouldnt be any real difference, not like how its affecting the situation there
smasta has quit [Ping timeout: 240 seconds]
* whoman nodly
<jmercouris> what if you make the two lists different, does the error still appear?
<jmercouris> like in one of the tests you do '(1 2 3) and in the other '(1 2 3 4)?
<defaultxr> it doesn't, if the two lists are different. i'm guessing it has something to do with this: https://stackoverflow.com/a/578365 "DO NOT USE QUOTE TO CREATE LISTS THAT YOU WILL LATER MODIFY. The spec allows the compiler to treat quoted lists as constants"
<defaultxr> it's weird, though, that it never happened when i was using prove.
<jmercouris> possibly the order of operations
<jmercouris> or maybe different contexts with threads or something, no idea
<|3b|> yeah, modifying literals is undefined behavior
fikka has joined #lisp
<jmercouris> |3b|: So if I do something like (push 1 '(1 2 3)) what will I get?
<|3b|> an error, since PUSH requires a place not a list?
<jmercouris> Lol shit, yes, you are correct
<|3b|> PUSH doesn't modify the list stored at that place when called correctly though, it just changes the contents of the place to point to a list whose CDR is the previous list
<jmercouris> |3b|: How about this (setf a '(1 2 3)) (push 1 a)
<|3b|> if that previous list was a literal, you are allowed to modify the car/cdr of the new value, since that cons was created by PUSH, but you are not allowed to modify any car/cdr past that, since they are from the literal list
<beach> jmercouris: That does not modify the list.
<|3b|> right, that's the 'correct' i was talking about
<|3b|> the value stored in A is modified, but not the list previously stored in A
<jmercouris> Aha, I see, it won't let me do a pop on that list
<jmercouris> I assume pop does actually modify the list instead of returning a copy of the list with the element missing
<|3b|> pop is also fine even on literal lists, since it only modifies variable bindings
<|3b|> if you retain another binding to the beginning of the list, it still exists unchanged
fikka has quit [Ping timeout: 256 seconds]
<jmercouris> There's a special type of destructive and non destructive lisp operations
<jmercouris> What is the name for these?
<|3b|> (theoretically it still remains unchanged even if you don't, but GC will may affect in ways you can no longer detect, but which wont affect the behavior of your program)
dtornabene has quit [Quit: Leaving]
<jmercouris> Ah, seems to be literally called destructive and non-destructive :D
<jmercouris> SO like the difference between (nreverse) and (reverse)
smurfrobot has joined #lisp
<jmercouris> is there a strong argument for using recycling functions?
<jmercouris> Are they more performant? or do they yield some other benefit?
<|3b|> right, nreverse may modify the structure of its arguments, so shouldn't be called on literals
<|3b|> just performance
<|3b|> (space and time)
<jmercouris> So basically if you are manipulating a piece of data over and over again to avoid gc you might use a recycling function instead
<jmercouris> how expensive is GC in lisp, and how/when is it invoked?
<|3b|> note that not all of them are /required/ to work in-place, so probably should check the spec (and/or rethink the algorithm) if that matters a lot
aindilis has quit [Ping timeout: 248 seconds]
fikka has joined #lisp
<|3b|> expense of GC depends on your data to some extent, lots of conses is more expensive to GC than same amount of storage for vectors specialized for things like fixnums or characters that can be known not to contain other objects
<|3b|> when it is invoked depends on the implementation, usually in some way related to amount of allocations
<aeth> |3b|: Does that mean one big 2D array is better than a vector of specialized vectors because the latter has a T vector that has to be walked through?
smurfrobot has quit [Remote host closed the connection]
<jmercouris> |3b|: What is the expensive part based upon the number of cons' is each cons cell it's own object that must be free'd?
<jmercouris> s/it's/its
<|3b|> right, though small effect on GC time might be outweighed by increased costs in the actual code if the abstraction is worse
<jmercouris> basically on a system level here, when we run a GC in lisp, are we actually freeing the memory, or is it just now available within our loaded lisp image as "free" memory?
<|3b|> jmercouris: speaking very generally, GC tends to involve walking through all objects on the heap starting at for example a register or other known starting point to see what is still 'alive'
fikka has quit [Ping timeout: 268 seconds]
<jmercouris> furthermore, is this memory every coalesced or just exists neubulously within the lisp image, and then has to be coalesced to reduce the size of the image?
<jmercouris> s/every/ever
<|3b|> if you have a 1 million element list of numbers, it has to look at 1 million conses. and at each number to verify it is just a fixnum/single-float/etc that doesn't need further processing (and if not, walk whatever is there)
<|3b|> if you replace that with an untyped array, it skips the million conses, but still has to look at the million values
<jmercouris> but it might not have to free those conses basically?
<|3b|> if you switch to a specialized array, it can say "this 1 array only holds fixnums, so it can't hold anything else i need to look at" and the whole array is 1 check
<jmercouris> what is the garbage collection strategy in lisp? is it different across implementations?
<jmercouris> So there exist some optimizations for the compiler to be more efficient, makes sense
<|3b|> it is not really specific to lisp
<jmercouris> or not the compiler, but the running image
<jmercouris> |3b|: I guess one could use any of many strategies, but I'm asking in a general sense, what to expect
<|3b|> and differs between implementations (or even options/architectures within an implementation)
<jmercouris> if I am running SBCL, what kind of behavior could I see
smurfrobot has joined #lisp
<|3b|> what i said already is pretty much the level i would suggest caring about it :)
<jmercouris> Okay, so it is all over the place, and I shouldn't worry too much about it except for when I can use recycling or somehow let the compiler/system know to optimize something
<|3b|> (until you start noticing GC pauses at least)
<jmercouris> Do you know of any lisp implemenations wich use reference counting in their GC?
<jmercouris> e,g, an extension to manually increase and decrease the reference count
* |3b| doesn't even usually bother with using the destructive functions (and then only on obvious things like a list i just created, like in the push + nreverse idiom)
* |3b| wouldn't really call ref counting GC :)
<jmercouris> Yes, okay let me be more specific
<|3b|> i don't know of any lisps that use it though
<jmercouris> do you know of any lisp implementations that use reference counting to facilitate gc in an efficient manner?
fikka has joined #lisp
<|3b|> lisps tend to want small conses, which doesn't work well with refcounting
<jmercouris> fair enough
<jmercouris> I remember back in the early days of dalvik, good times, GC would freeze the phone for several frames
<|3b|> also possibly more likely to have cycles that some languages
smasta has joined #lisp
<jmercouris> and there was no easy way to 1. limit when it runs, 2. control what it garbage collects (technically you could, but it was an abuse of java)
<|3b|> symbols + packages + closures can make some big non-obvious cycles
<jmercouris> Also a good time
<jmercouris> Well, thank you for this information
<jmercouris> now I can not worry about GC
<aeth> I have a game loop that essentially doesn't cons at all (a tiny bit of cl-sdl2 it uses conses a little; I'll have to replace cl-sdl2 eventually)
<aeth> It's hard
<aeth> You have to pre-allocate everything and write a ton of macros to make complicated things seem natural
<jmercouris> Sounds like Lisp is not a good language for game programming then
<jmercouris> not enough granular control over memory
<aeth> I wouldn't recommend doing non-consing unless you really needed it
fikka has quit [Ping timeout: 256 seconds]
<aeth> jmercouris: No language is good for game programming, then. C++ engines literally never get completed because C++ is is hard to do right when you're writing a large application
<jmercouris> aeth: I would disagree with that, C# and the XNA platform are pretty damn good
<jmercouris> I don't even like C#, but I can't pretend it isn't good for game programming, MS put a lot of work into it
<|3b|> jmercouris: people made plenty of games in flash with bad GC, lots of games in JS with bad GC, failure to make games in CL can't be blamed on GC :/
smasta has quit [Ping timeout: 264 seconds]
<aeth> jmercouris: Most C# game programming (by an overwhelming amount) uses an engine (Unity) written in C++
<|3b|> and even if it were horrible, i'd still argue for prototyping in CL even if parts of final thing had to be reimplemented in C or whatever
<jmercouris> aeth: 5-10 years ago was a different story
<|3b|> oh yeah, and $billions of java games
<jmercouris> Java also has terrible GC indeed, thats why I mentioned Dalvik, when I was doing some very very early android games, what a nightmare
oleo has joined #lisp
<jmercouris> there's perhaps just not a good platform for CL, so maybe that's why nobody writes games in CL
<jmercouris> not literally nobody, but you know what I mean
<|3b|> right, dalvik games too (different VMs, so java GC isn't dalvic GC)
<loke> jmercouris: In what way is the Java GC terrible?
yrdz has quit [Ping timeout: 240 seconds]
<|3b|> (java actually has some good GCs from what i hear, no idea if the defaults on consumer java stuff are any good though)
randomstrangerb has quit [Ping timeout: 240 seconds]
<loke> |3b|: Java probably has the best CG's available in any system. It's not focused as much on low/zero latency though, and tuning for near-realtime can be a hassle, which is what I suspect jmercouris was referring to.
<|3b|> doesn't help that there are lots of ways to rate a GC, some tasks might think a high-throughput GC is great (batch jobs that run over night for example), while some things might care about latency (games, sort of), or maximum pauses (games)
<aeth> jmercouris: Anyway, I would argue that CL is the only language suitable for game programming. No matter how badly you have to abuse the language (and literally every large enough game engine will run into limitations with the language unless the engine authors also wrote the language) you can cover it up with metaprogramming. And not the kind of painful metaprogramming you'd see in a language like C++.
iqubic has quit [Remote host closed the connection]
randomstrangerb has joined #lisp
<aeth> jmercouris: Sure, maybe the CL implementations haven't really caught up yet, but optimizations follow use, they don't precede it.
<aeth> You're wasting time as a language implementor if you optimize for things that no one is writing.
<loke> |3b|: Java comes with several GC's that you can choose between. And on top of that you can tune them in about a million ways. The default GC is great for long-running server applications, which is kinda the opposite of games. So yeah, for games stuff you have some tuning to do.
<loke> The highest-profile game written in Java (not counting Android( is probably Minecraft.
<jmercouris> loke: The implementation on Dalvik was a nigthmare, go ahead and spin up some old android vms and you'll see what I mean
<|3b|> yeah, that's the one i was thinking of :)
<aeth> loke: and Minecraft was poorly optimized Java, which gave Java gamedev a bad reputation
* |3b| played at least a few others too though
<loke> jmercouris: When I say Java, I'm preferring to the Sun implementation.
<loke> Android is a differen thing altogether.
<loke> Also, Android now has multiple implementations as well, so one has to be specific when talking about Dalvik, or ART, or the thing that ART has become in Android 8.
<jmercouris> loke: Sorry for the confusion :) you are right, I was being imprecise
<jmercouris> it is only recently in my mind that I've begun to distnguish between language and implementation
<|3b|> yeah, java language vs (java VM/runtime or dalvik vm/runtim) is confusing
<loke> As far as I can tell, the VM in Android 8 seems a lot better, but I haven't pushed it very hard. :-)
<aeth> jmercouris: And my non-consing style is actually unnecessary, I roughly lowered 4%-5% CPU usage to 2%-4% CPU usage
<jmercouris> aeth: Is it just sort of a goal for fun then?
<|3b|> or ABC or whatever the new runtime or vm or whatever it is is called
<aeth> (Although that reduction in CPU usage included replacing efficient SIMD linear algebra that consed with naive not-SIMD linear algebra that didn't cons)
<jmercouris> loke: The VM in Android can get as good as it likes, it's still a VM and, bare metal is always best
<|3b|> that's why they let you write native code too :)
<jmercouris> as much as I like the java "code once, run everywhere", the experience is still a pipe dream, and it is 2018 now
<aeth> jmercouris: I'm writing a game engine because it prioritizes CPU performance without having any real RAM limitations. That's a fun combination for me.
<jmercouris> |3b|: I remember when NDK was so terribly documented, there wasn't even ANY documentation
<loke> jmercouris: The question is how close to Java the VM is... The problem with the JVM is that a lot of its features are designed to make Java very efficient, but makes it hard to implement some features of other languages (efficiently).
<jmercouris> I also remember having to edit special strings in eclipse to load your APK onto different phones
<jmercouris> loke: I have no problem with the JVM speficically, I have problem with VMs in general
DevilsDulcimer has joined #lisp
<DevilsDulcimer> anyone have any experience working with outsourcing? preferably an American company working with Indians over Telecommuting solution such as skype...are they a viable lot when it comes to going forward with a tech company?
<loke> jmercouris: THat is fortunately no the case now. OWEVER, it's worse in another way. Now the entire ecosystem is based on Gradle, which is probably the worst piece of shit build system I ever had the misfortune to be force to work with.
<jmercouris> DevilsDulcimer: I have only bad experiences
<|3b|> DevilsDulcimer: this channel is about Common Lisp, not outsourcing
<aeth> Is there an outsourcing firm with Common Lisp experience?
<jmercouris> loke: Gradle is a war crime, I'm not sure why they pushed that and the Intellij train so hard
<jmercouris> loke: Is google getting kickbacks from jetbrains or something :D?
<loke> jmercouris: IntelliJ is great, but what they did to it when thet made AS was a disaster
fikka has joined #lisp
<loke> jmercouris: I used to do ANdroid development in IDEA, and clicking on "run" compiled an, built, and deployed on the emulator in about 5 seconds.
<aeth> If there's a quality outsourcing firm with Common Lisp experience, maybe we could crowdfund some patches to key CL projects.
<jmercouris> loke: That's pretty good
<loke> jmercouris: With Gradle and AS, that increased to about a minute. It's better now, if you're lucky enough that the damn thing doesn't roll over and die on you.
vibs29 has quit [Ping timeout: 265 seconds]
<jmercouris> I'm really not even seeing why gradle was necessary
<DevilsDulcimer> thanks for the info
<loke> Oh, and if you _DARE_ to try to load load an old project after 3 weeks of not using it, it won't beuild anymore because Gradle decides to upgrade half your dependencies and nothign will work anymore, and you are force to cargo-cult random changes in your Gradle project file to get it to run again... MAYBVE
<jmercouris> loke: Though I'm sure it had some reason, just like the existence of "go"
deng_cn1 has joined #lisp
deng_cn has quit [Ping timeout: 256 seconds]
deng_cn1 is now known as deng_cn
<jmercouris> loke: Lol I love those stack overflow "I changed x to y" in these lines for upgrades which are basically breaking against user will, and undocumented
<loke> The funny thing is that I listen to the Android Developers podcast (by the Android team at Google themselves), and they'
<loke> re falling over themselves to praise it as the best thing ever.
<loke> What goddamn world do they live in?
vibs29 has joined #lisp
<jmercouris> What's wrong with maven? what's wrong with manually coyping some jars when you need them?
<jmercouris> I literally cannot find a reason for gradle to exist other than google's big ego
<loke> jmercouris: I absolutely abhor maven, and it's quiote telling that I'd gladly commit to Maven 100% just to be able to get rid of Gradle.
<jmercouris> It's a case of lesser evils here, that's all I'm saying
cromachina_ has joined #lisp
<loke> The worst par tis that Gradle is just a script, with a horrific syntax hack to make Groovy look like a DSL. That means that every single line is executable and then AS attempts to actually parse this thing to make sense of it.
<loke> OF COURSE it's nt going to work
fikka has quit [Ping timeout: 252 seconds]
<jmercouris> I didn't even know that, but it doesn't exactly shock me, that's some next level stuff... in a bad way
<loke> Damn it... Just thinking about that crap makes me angry. I need to go have lunch now and cool down.
<jmercouris> Enjoy your lunch, and try not think about it :)
<beach> jmercouris: Reference counting is way more expensive than tracing collectors, and on top of that, it doesn't work for cycles.
<jmercouris> beach: Reference counting when manually invoked is cheaper
<loke> jmercouris: Try it next time, pluck some Groovy code in there (it's essentially Java with a more scripty syntax, but most Java constructs still work) and see the... erm... beauty
<jmercouris> beach: automatic reference counting is more expensive, for sure
cromachina has quit [Ping timeout: 240 seconds]
<jmercouris> beach: of course reference counting will also fail for cycles, it's just made for lightweight applications, but I see your point
<beach> jmercouris: It is not.
<jmercouris> How so? reference counting is MOST DEFINITELY lighter, you simply maintain a hash table of counts, in fact, you could even maintain a sorted hash table
<beach> jmercouris: By reference counting, we mean that when a variable is assigned to, the object previously contained in it has its reference count decremented and tested for 0.
<jmercouris> By reference counting, I mean (refcount++ varx)
<jmercouris> obviously such syntax doesn't exist
<beach> jmercouris: Yes, so every time you do an assignment, you have to go to memory and update a reference counter. On modern processors that kills performance.
<jmercouris> Yes, but garbage collection itself will be faster
<beach> jmercouris: Go read the literature.
<loke> jmercouris: The issue with refcounting is that you have to access this refcount variable all the time, and in a multithreaded environment you also need some way of dealing with data races
<jmercouris> Perhaps assignment will be slightly slower, eg. intialization code, but garbage collection will definitely be faster
<beach> jmercouris: And C# uses garbage collection as well, so there is nothing related to garbage collection that makes C# better suited for anything than Common Lisp.
<jmercouris> beach: the comment about C# was the framework that MS built around it
<rme> reference counting spreads out the pain. with a tracing gc, you suffer the pain all at once, but you get a bulk discount.
<jmercouris> beach: I'm pretty well read on GC in general
<jmercouris> as I've done a lot of optimization with it in my time
<beach> Good for you.
<jmercouris> I'm 100% sure that a manual reference count based system is the absolute fastest
<jmercouris> not some form of automatic reference counting, not some form of marking relations, but literally incrementing referencing counts manually as a user
<jmercouris> it's just BARELY different than manually alloc and freeing memory, but can mean a performance boost in some cases where you know you don't need to actually now mark something during a transient operation (for example)
damke_ has joined #lisp
<loke> jmercouris: There is also the issue of bookeeping. In C, for example, both allocating and freeing memory requires the malloc implementation manage a tree of free memory structures which can be quite expensive. In a compating GC language, a malloc() is essentially a single instruction (an ADD, moving the free memory pointer), and a free() takes zero cycles, since you simply drop the pointer.
<loke> Of counrse the GC intself takes some reasoucres, but it's not clear-cut which one wins.
<beach> jmercouris: Earlier you asked about CONS cells being freed. Did you think that some version of free() was being called in order to free those cells?
<jmercouris> beach: That's what I had in mind yes
<beach> jmercouris: Then your knowledge of GC is a few decades too old.
damke has quit [Ping timeout: 264 seconds]
<jmercouris> I don't believe so, I literally just this past year studied GC, within the context of distributed systems even
<jmercouris> perhaps there is a misunderstanding here
<beach> Maybe so.
smurfrobot has quit [Remote host closed the connection]
<jmercouris> loke: Yeah, that was more or less my question about what common lisp implementation is likely doing when freeing a cons cell
<jmercouris> CL has surprised me in so many ways so I keep asking questions that I know the answer to in other languages, but I'm never sure
<loke> jmercouris: I presume you are referring to the work neede by the GC to release the memory used by CONS cells that have been released?
smurfrobot has joined #lisp
<jmercouris> loke: Yes
<rme> https://www.amazon.com/dp/1420082795 is a pretty standard gc reference, fwiw
<beach> As loke says, a modern GC does not touch unreferenced objects, so it does not "free" any cells. And this is not specific to Common Lisp. It has to do with modern GC algorithms.
damke has joined #lisp
<jmercouris> beach: This I'm aware of, believe me :D
<loke> jmercouris: By the time the GC frees the unused memory, that memory dones not consist of CONS cells any more. It's just a blob of memory that no one cares about :_)
<jmercouris> so common lisp is like the rest then
<aeth> I heard before in this channel that SBCL doesn't have a good GC and that CCL's GC is better.
<loke> jmercouris: Of course, things like weak references makes this a bit more subtle.
fikka has joined #lisp
<loke> aeth: There are certainly problems with the SBCL GC. It could be a lot better. But it's not terrible.
<aeth> loke: how could it be a lot better?
Kevslinger has quit [Quit: Connection closed for inactivity]
<loke> aeth: well, of example, there are cases where it needs to fill a structure with zeroes instead of just dropping the reference in order for the GC not to mistake random values with a pointer. It was disucced on the SBCL devel mailing list last week in fact.
damke_ has quit [Ping timeout: 264 seconds]
<loke> But one could always use ABCL and by extension autoamtically use the Java VM's GC :-)
jstypo has quit [Read error: Connection reset by peer]
fikka has quit [Ping timeout: 248 seconds]
<loke> OK, now I'm seriously going to have lunch
<jmercouris> beach: here's where I was asking that question: "basically on a system level here, when we run a GC in lisp, are we actually freeing the memory, or is it just now available within our loaded lisp image as "free" memory?"
<beach> jmercouris: The Common Lisp standard has nothing to say about that subject.
<beach> jmercouris: But most GC algorithms, just like malloc() and free() do not give memory back to the operating system.
deng_cn has quit [Quit: deng_cn]
deng_cn has joined #lisp
<jmercouris> Yep, always better safe than sorry though :P
<jmercouris> I've been burned through assuming too much in my life :D
<jmercouris> I always think I know more than I do...
<aeth> I know I know more than I do
<fouric> "By the time the GC frees the unused memory, that memory dones not consist of CONS cells any more. It's just a blob of memory that no one cares about"
<jmercouris> aeth: Presumably always one would know more than they do because knowledge always precedes action
<fouric> what does "does not consist of CONS cells any more" mean
<fouric> is there actually a change in memory
<fouric> ...or do we not consider them "cons cells" because for our intents and purposes they aren't?
<fouric> (physical memory changing vs. the meatspace metainformation changing)
<fouric> ...or (c) none of the above?
oleo has quit [Quit: Leaving]
smasta has joined #lisp
smurfrobot has quit [Remote host closed the connection]
makomo has joined #lisp
<beach> fouric: Because all information about the exact contents of that memory has been lost. At some level, there are still Common Lisp objects there, of course, but as far as the system knows, it is just random garbage.
<fouric> oh, i see
smasta has quit [Ping timeout: 264 seconds]
fikka has joined #lisp
smurfrobot has joined #lisp
jstypo has joined #lisp
<fouric> ...and one more question since we're talking about GC anyway: can SBCL's garbage collector run concurrently with running programs?
<fouric> i poked around in the manual, which says that it's a "generational" garbage collector
smurfrobot has quit [Remote host closed the connection]
<fouric> ...but i haven't been able to determine if that says anything about its ability to run in parallel with the program it is managing
Bike has quit [Quit: Lost terminal]
<rme> last I knew, sbcl's collector was not concurrent. ccl's is not concurrent, either.
<fouric> hm, ok
randomstrangerb has quit [Ping timeout: 256 seconds]
<fouric> so "concurrent" is the keyword i'm looking for?
<krwq> soes anyone know how to write strings to in-memry-stream with flexi-streams? I've tried with-output-to-sequence + setf flexi-stream-external-format and also wrapping that stream with another flexi stream with :external-format set
<fouric> *was the word, you appear to have answered my question
zazzerino has quit [Ping timeout: 256 seconds]
randomstrangerb has joined #lisp
<rme> generational is something else entirely.
<fouric> ah, so they're mostly orthogonal
fikka has quit [Ping timeout: 268 seconds]
<rme> entirely orthogonal, I would say
<fouric> neat! that explains a lot
<fouric> ty ty
<fouric> (...would you happen to have any suggested resources for reading up on garbage collection and memory management?)
<rme> well, there's that amazon link I pasted earlier
smurfrobot has joined #lisp
<krwq> actually bummer - it worked correctly but I misread the error (it was on file-length call)
terpri has joined #lisp
<fouric> neat, i'll grab a copy of that book when i have time
<fouric> ooh
<fouric> both of those look very useful, thanks!
<aeth> Looks like I just learned that the magic words that a game would need are "real-time concurrent garbage collection"
<rme> you win gc bingo
<aeth> Many of the results seem to add "parallel" too
<aeth> about half
vlatkoB has joined #lisp
<rme> sometimes use the phrase "stop the world" to describe collectors which are sort of the opposite (and which are more tractable to implement and thus more common)
<aeth> oh good that patent was published in 1992, the world is allowed to progress now
<aeth> I guess you can say that patents on garbage collection are... stop the world.
<fouric> lol
<fouric> real-time, concurrent, *and* parallel! :D
* fouric is not very good at search-engine bingo, which is why he asks for recommendations from humans whenever possible
DevilsDulcimer has left #lisp [#lisp]
<aeth> Search engines are great as long as you know exactly what you're searching for.
fikka has joined #lisp
randomstrangerb has quit [Ping timeout: 252 seconds]
<beach> fouric: Here is another great paper: https://dl.acm.org/citation.cfm?id=1134023
shka_ has joined #lisp
randomstrangerb has joined #lisp
fikka has quit [Ping timeout: 260 seconds]
smurfrobot has quit [Remote host closed the connection]
fikka has joined #lisp
safe has quit [Read error: Connection reset by peer]
mishoo has joined #lisp
shrdlu68 has quit [Ping timeout: 252 seconds]
Karl_Dscc has joined #lisp
Oladon has quit [Quit: Leaving.]
fikka has quit [Ping timeout: 256 seconds]
LocaMocha is now known as Sauvin
smurfrobot has joined #lisp
fikka has joined #lisp
shrdlu68 has joined #lisp
smurfrobot has quit [Ping timeout: 240 seconds]
fikka has quit [Ping timeout: 240 seconds]
smurfrobot has joined #lisp
dec0n has joined #lisp
dieggsy has quit [Ping timeout: 252 seconds]
zooey has quit [Remote host closed the connection]
zooey has joined #lisp
fikka has joined #lisp
ebzzry has quit [Read error: Connection reset by peer]
hiroaki has quit [Ping timeout: 240 seconds]
smurfrobot has quit [Ping timeout: 240 seconds]
Karl_Dscc has quit [Remote host closed the connection]
fikka has quit [Ping timeout: 240 seconds]
ebzzry has joined #lisp
smurfrobot has joined #lisp
fikka has joined #lisp
solyd has joined #lisp
marusich has quit [Ping timeout: 252 seconds]
smurfrobot has quit [Ping timeout: 256 seconds]
hiroaki has joined #lisp
fikka has quit [Ping timeout: 252 seconds]
smasta has joined #lisp
panji has joined #lisp
scymtym has quit [Ping timeout: 256 seconds]
flamebeard has joined #lisp
vaporatorius has joined #lisp
vaporatorius has joined #lisp
vaporatorius has quit [Changing host]
vap1 has joined #lisp
vaporatorius has quit [Client Quit]
fikka has joined #lisp
DeadTrickster_ has quit [Ping timeout: 248 seconds]
fikka has quit [Ping timeout: 256 seconds]
ioa has joined #lisp
<ioa> good morning
<jmercouris> ioa: good morning
<jmercouris> what's the best way to create a config file that can be loaded by a standalone lisp program?
JonSmith has joined #lisp
<jmercouris> I've forked "site-generator" and I want to be able to pass it a series of commands to execute in the form of a config file
<jmercouris> I'd like the location of that config file to be variable
<jmercouris> e.g. if I launch "site-generator" in a dir with a config file, it should pick up that config file
<jmercouris> I guess the real question I am asking is, how can my program know from where it was launched in order to load the appropriate lisp file?
<jmercouris> s/lisp file/configuration file
fikka has joined #lisp
randomstrangerb has quit [Ping timeout: 240 seconds]
randomstrangerb has joined #lisp
smurfrobot has joined #lisp
JonSmith has quit [Ping timeout: 246 seconds]
<Shinmera> (uiop:argv0)
<Shinmera> That is, if you're using a standalone executable
<Shinmera> If it's a source file, the usual trick is #.(make-pathname :name NIL :type NIL :defaults (or *compile-file-pathname* *load-pathname* (error "Welp"))
<Shinmera> )
<jmercouris> (uiop:getcwd) seems to be working now
<Shinmera> The cwd is not the directory the program is in.
<jmercouris> It seems to work that way though
<Shinmera> Not necessarily anyway.
<jmercouris> I tried moving the binary around
<jmercouris> ah damnit that's the issue
<jmercouris> that's where the binary is located, not where the program was launched from
<jmercouris> terminal wise
<Shinmera> The cwd is where it was launched from. argv0 is where the binary is.
Ven`` has joined #lisp
<jmercouris> Let me try again
<jmercouris> Ah, you are correct
<jmercouris> I wonder what I was doing wrong earlier
<jmercouris> Thanks for your help!
fikka has quit [Ping timeout: 260 seconds]
Cymew has joined #lisp
fikka has joined #lisp
solyd has quit [Quit: solyd]
panji has left #lisp [#lisp]
DeadTrickster has joined #lisp
shka_ has quit [Ping timeout: 256 seconds]
karswell has quit [Ping timeout: 256 seconds]
smurfrobot has quit [Remote host closed the connection]
Ven`` has quit [Read error: Connection reset by peer]
DeadTrickster has quit [Ping timeout: 240 seconds]
smurfrobot has joined #lisp
Ven`` has joined #lisp
smurfrobot has quit [Remote host closed the connection]
DeadTrickster has joined #lisp
smurfrobot has joined #lisp
DeadTrickster has quit [Remote host closed the connection]
bentaisan has joined #lisp
Amplituhedron has quit [Read error: Connection reset by peer]
milanj has joined #lisp
<jackdaniel> fwiw cwd may be changed to something else at runtime
<jackdaniel> what's more, *default-pathname-defaults* and current working directory may be inconsistent (because one or another may be adjusted at runtime independently)
deng_cn has quit [Read error: Connection reset by peer]
drcode has joined #lisp
drcode has quit [Remote host closed the connection]
deng_cn has joined #lisp
drcode has joined #lisp
scymtym has joined #lisp
varjag has joined #lisp
<p_l> at least it's rare these days to write lisp for OS that doesn't have the concept of CWD ;)
<whoman> mute ability
raynold has quit [Quit: Connection closed for inactivity]
smurfrobot has quit [Remote host closed the connection]
drcode has quit [Quit: ZNC 1.6.5 - http://znc.in]
<p_l> IIRC, on windows it can be hard to get path to executable
drcode has joined #lisp
<jackdaniel> right, I usually get confused after B:\ part ;-)
* p_l recalls the times when he had A: and B: ...
damke_ has joined #lisp
bentaisan has quit [Quit: Textual IRC Client: www.textualapp.com]
Murii has joined #lisp
damke has quit [Ping timeout: 264 seconds]
jmercouris has quit [Ping timeout: 248 seconds]
Guest83322 has left #lisp [#lisp]
kolb has joined #lisp
shrdlu68 has quit [Quit: Lost terminal]
smurfrobot has joined #lisp
_cosmonaut_ has joined #lisp
shrdlu68 has joined #lisp
igemnace has quit [Read error: Connection reset by peer]
igemnace has joined #lisp
<paule32> hello
attila_lendvai has joined #lisp
attila_lendvai has joined #lisp
attila_lendvai has quit [Changing host]
<paule32> can someone check against the result 10 :
<paule32> tia
smurfrobot has quit [Remote host closed the connection]
smurfrobot has joined #lisp
ghard has joined #lisp
JonSmith has joined #lisp
dilated_dinosaur has quit [Ping timeout: 240 seconds]
heurist` is now known as heurist
JonSmith has quit [Ping timeout: 256 seconds]
dilated_dinosaur has joined #lisp
dilated_dinosaur has quit [Ping timeout: 252 seconds]
hhdave has joined #lisp
capitaomorte has joined #lisp
<hjudt> is there an easy way to read a whole text file into a string instead of reading it line by line and concatenating?
<shrdlu68> hjudt: Alexandria has read-file-into-string.
<hjudt> cool thanks
smasta has quit [Ping timeout: 248 seconds]
snafu_ has joined #lisp
dilated_dinosaur has joined #lisp
smurfrobot has quit [Remote host closed the connection]
smurfrobot has joined #lisp
deng_cn has quit [Quit: deng_cn]
wxie has joined #lisp
smurfrobot has quit [Ping timeout: 240 seconds]
igemnace has quit [Quit: WeeChat 2.0.1]
snafu_ has quit [Read error: Connection reset by peer]
quazimodo has quit [Ping timeout: 240 seconds]
Chream_ has quit [Read error: Connection reset by peer]
Chream_ has joined #lisp
aindilis has joined #lisp
wxie has quit [Ping timeout: 240 seconds]
quazimodo has joined #lisp
Posterdati has quit [Ping timeout: 240 seconds]
orivej has joined #lisp
nowhere_man has quit [Ping timeout: 256 seconds]
jameser has joined #lisp
krwq has left #lisp ["Killed buffer"]
damke_ has quit [Read error: Connection reset by peer]
Kaisyu has quit [Quit: Connection closed for inactivity]
damke_ has joined #lisp
windblow has joined #lisp
arbv has quit [Quit: ZNC - http://znc.in]
pilfink has joined #lisp
arbv has joined #lisp
_cosmonaut_ has quit [Ping timeout: 256 seconds]
muyinliu has joined #lisp
nirved has joined #lisp
smasta has joined #lisp
dddddd has joined #lisp
smasta has quit [Ping timeout: 240 seconds]
_cosmonaut_ has joined #lisp
Ven`` has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Amplituhedron has joined #lisp
jmercouris has joined #lisp
DeadTrickster has joined #lisp
jameser has quit [Ping timeout: 256 seconds]
<jmercouris> How can I print without the quotes?
<jmercouris> I have "a string" and I want to print just "a string" not ""a string""
<jackdaniel> format t "~A" my-string
<jmercouris> ah so not ~s
<shrdlu68> ~S prints readably
<jackdaniel> you may want to read about the differences between ~s and ~a (readably vs unreadably)
<jmercouris> ok, I'll take a look, thank you
<jackdaniel> princ vs prin1
wigust has joined #lisp
Kevslinger has joined #lisp
damke has joined #lisp
damke_ has quit [Ping timeout: 264 seconds]
fikka has quit [Ping timeout: 240 seconds]
jstypo has quit [Remote host closed the connection]
windblow has quit [Ping timeout: 268 seconds]
DeadTrickster has quit [Remote host closed the connection]
shrdlu68 has quit [Remote host closed the connection]
jtza8 has joined #lisp
shrdlu68 has joined #lisp
damke_ has joined #lisp
jtza8 has quit [Ping timeout: 252 seconds]
jtza8 has joined #lisp
damke has quit [Ping timeout: 264 seconds]
Chream_ has quit [Read error: Connection reset by peer]
Chream_ has joined #lisp
EvW has joined #lisp
m00natic has joined #lisp
fikka has joined #lisp
pilfink has quit [Ping timeout: 252 seconds]
Chream_ has quit [Read error: Connection reset by peer]
damke has joined #lisp
Chream_ has joined #lisp
damke__ has joined #lisp
damke_ has quit [Ping timeout: 264 seconds]
Chream_ has quit [Read error: Connection reset by peer]
eivarv has joined #lisp
damke has quit [Ping timeout: 264 seconds]
Chream_ has joined #lisp
Chream_ has quit [Read error: Connection reset by peer]
jameser has joined #lisp
genos has joined #lisp
<genos> hi
Chream_ has joined #lisp
<genos> anyone know how to create functions for eshell?
<Shinmera> Try #emacs
DeadTrickster has joined #lisp
shifty has quit [Ping timeout: 240 seconds]
<genos> i cant join:/
<genos> services something
<jmercouris> genos: All emacs functions should be invokable in eshell
<Shinmera> genos: Well, this is not the channel for elisp or emacs.
Chream_ has quit [Read error: Connection reset by peer]
<genos> jmercouris: im trying to make emacs sync to a pendrive.
<genos> (defun eshell/booksync () "syncs my books"
<genos> (sudo rsync --verbose -r --ignore-existing /media/${whoami}/247B-947E/books/* ~/Downloads/books))
<genos> (sudo rsync --verbose -r --ignore-existing ~/Downloads/books/* /media/${whoami}/247B-947E/books)
<genos> (interactive)
<Shinmera> genos: Stop
<genos> whats wrong with it?:<
Ven`` has joined #lisp
<Shinmera> This is not the channel for elisp or emacs. And it's even less the channel to just paste code into.
<genos> elisp is a lisp :^)
<Shinmera> It's not common lisp.
Chream_ has joined #lisp
<Shinmera> Mind the topic.
<genos> aah:<
<genos> well jmercouris can you help anyway?
<jmercouris> genos: I've messaged you already to avoid polluting this channel
<genos> ty
solyd has joined #lisp
windblow has joined #lisp
SaganMan has joined #lisp
smurfrobot has joined #lisp
jtza8 has quit [Remote host closed the connection]
shrdlu68 has quit [Ping timeout: 240 seconds]
smurfrobot has quit [Ping timeout: 256 seconds]
jmercouris has quit [Ping timeout: 256 seconds]
<genos> nooooooooo
<genos> :/
aabcds has joined #lisp
EvW has quit [Remote host closed the connection]
aabcds has quit [Client Quit]
EvW has joined #lisp
genos has left #lisp ["ERC (IRC client for Emacs 25.2.2)"]
solyd has quit [Quit: solyd]
jameser has quit [Quit: Textual IRC Client: www.textualapp.com]
orivej has quit [Ping timeout: 264 seconds]
solyd has joined #lisp
Ven`` has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
pilfink has joined #lisp
smasta has joined #lisp
defaultxr has quit [Ping timeout: 240 seconds]
smasta has quit [Ping timeout: 256 seconds]
nullman has quit [Ping timeout: 252 seconds]
nullman has joined #lisp
<Xach> scymtym: what is lisplab?
JonSmith has joined #lisp
<Xach> Google helped me find it.
hiroaki has quit [Ping timeout: 256 seconds]
<Xach> scymtym: xml.location references lisplab in one of its systems, but lisplab isn't in quicklisp - should i add lisplab? or ignore the xml.location system?
thijso has quit [Ping timeout: 246 seconds]
dddddd has quit [Ping timeout: 240 seconds]
dddddd has joined #lisp
Ven`` has joined #lisp
Ven` has joined #lisp
solyd has quit [Quit: solyd]
<scymtym> Xach: it used to be an optional dependency but is no longer relevant. i can just remove the integration
Ven`` has quit [Ping timeout: 248 seconds]
<scymtym> Xach: i have been meaning to do that for quite some time but forgot about it. thanks for bringing it up
<ebrasca> Can I delete characters from some file to make it smaller?
<Shinmera> That depends on your file system, but generally no. You can write out a new file and delete the old one though.
<billitch> ebrasca: you have truncate(1) on unix
<ebrasca> billitch: I am working on mezzano OS.
<scymtym> Xach: removed in master
<Xach> scymtym: thanks
<billitch> maybe truncate(2) is in cffi-unistd
<billitch> ebrasca: i'm working on CL VFS
<billitch> ;)
<ebrasca> billitch: Why someone need virtual FS?
<billitch> to map key values shared by multiple processes and users
<billitch> you need to abstract between disk layout and abstract contention problems
<billitch> maybe
<billitch> i'm not so comfortable with CL pathnames
<billitch> not perfect
<ebrasca> I like streams and files.
<billitch> i think breaking os dependency is achievable by any software including a vfs
<billitch> that is the case with web browsers
<billitch> they nearly took over personal computers
<billitch> the url scheme is subject of much more design than disk layout which is left to the OS
<billitch> or mongodb ffs
<billitch> and so would a global microkernel develop itself
<ebrasca> I am working on FAT32 implementation for Mezzano OS.
<billitch> ebrasca: oh great, without a vfs then ?
<ebrasca> billitch: There is some abstraction in mezzano for FS.
heurist has quit [Ping timeout: 240 seconds]
<billitch> when i say vfs i mean all the data structures that are common to all filesystems
<billitch> well i think the most common data structure is a variable length string which is the filename
<billitch> and maybe there is nothing beyond that
heurist has joined #lisp
<billitch> but then you have permissions
<billitch> which are handled through rsa keys mostly
<ebrasca> FAT32 have long names in segments
<billitch> ebrasca: do you have a git repo ?
<ebrasca> billitch: Yes
damke has joined #lisp
papachan has joined #lisp
arbv has quit [Ping timeout: 256 seconds]
smurfrobot has joined #lisp
damke__ has quit [Ping timeout: 264 seconds]
windblow has quit [Ping timeout: 264 seconds]
rippa has joined #lisp
Ven` has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
eivarv has quit [Quit: Sleep]
mnoonan has joined #lisp
smasta has joined #lisp
_mjl has joined #lisp
smurfrobot has quit [Remote host closed the connection]
smasta has quit [Ping timeout: 252 seconds]
Chream_ has quit [Read error: Connection reset by peer]
oleo has joined #lisp
Chream_ has joined #lisp
shrdlu68 has joined #lisp
fikka has quit [Ping timeout: 240 seconds]
Ven`` has joined #lisp
smurfrobot has joined #lisp
Chream_ has quit [Read error: Connection reset by peer]
solyd has joined #lisp
Chream_ has joined #lisp
fikka has joined #lisp
jmercouris has joined #lisp
Bike has joined #lisp
fikka has quit [Ping timeout: 240 seconds]
pjb has joined #lisp
<phoe> Do I want to use DPB?
Murii has quit [Quit: ¯\_(ツ)_/¯]
<phoe> Or should I rather use SETF LDB?
<_death> if you change a place, setf ldb.. if you return a new value, dpb
Chream_2 has joined #lisp
<pjb> phoe: up to you. So far I've used dpb.
<phoe> Oh wait. DPB does not mutate anything?
<phoe> Yes, I see.
<phoe> It's a pure function.
arbv has joined #lisp
Chream_ has quit [Ping timeout: 256 seconds]
<pjb> Because it's more like (dpb (dpb (dpb …))) to build words…
<Shinmera> phoe: numbers are immutable. (setf ldb) is the same as (setf place (dpb ..))
<pjb> (setf (ldb byte place) val) = (setf place (dpb val byte place)) ; but without the place duplication.
<phoe> Yes - thank you.
windblow has joined #lisp
<jmercouris> there doesn't appear to be a straightforward way to copy a dir in CL, is there one I'm not seeing?
SaganMan has quit [Quit: WeeChat 1.6]
<jmercouris> I see uiop:copy-file and I guess I could copy the folder file, but I'm not sure how that would work
<_death> jmercouris: copying a directory (or even a file) is not a straightforward operation.. it depends on what you want to use it for
<jmercouris> _death: I'm trying to copy a directory of static assets for exporting a site-generator page
<Shinmera> jmercouris: Use DIRECTORY, a wild-inferiors pathname, and COPY-FILE, and ENSURE-DIRECTORIES-EXIST.
<jmercouris> currently it makes a symlink to the static dir
<_death> jmercouris: here's an old snippet https://gist.github.com/death/2b7b1cfe6a38fc4b368ba91419c75e2e
<paule32> hello
<paule32> what is wrong:
<paule32> line 169
<jmercouris> _death: Checking it out now, thanks
zooey has quit [Remote host closed the connection]
shrdlu68 has quit [Ping timeout: 240 seconds]
<jmercouris> _death: Interesting, so you literally copy all the individual files
fikka has joined #lisp
zooey has joined #lisp
warweasle has joined #lisp
<_death> jmercouris: depending on your situation, it may even make sense to invoke cp -R or somesuch
<jmercouris> Shinmera: What do yo umean by "wild-inferiors" pathname? a pathname that includes a wildcard matching all child files of the dir I wish to copy?
Tobbi has joined #lisp
<jmercouris> cp -R isn't a bad idea for my use case, I may drop it into a "makefile"
<jmercouris> so I don't feel like I am dirtying the code too much
<Shinmera> jmercouris: For instance: (make-pathname :directory '(:absolute :home :wild-inferiors))
capitaomorte has quit [Ping timeout: 240 seconds]
<Shinmera> That matches all subdirectories.
<Shinmera> Well, all subdirectories in the home directory.
<Shinmera> You'll also need :name :wild :type :wild to match files.
<jmercouris> Shinmera: So i'd match all the dirs, and which I would then have to walk, and then match all the files and then copy them?
<Shinmera> No
<Shinmera> (directory (make-pathname :name :wild :type :wild :directory '(:absolute :home :wild-inferiors))) will list all files reachable from your home directory.
<jmercouris> That's totally fine
fikka has quit [Ping timeout: 240 seconds]
<jmercouris> But will copy-file also copy the dirs and the files in the same tree structure?
smurfrobot has quit [Remote host closed the connection]
LiamH has joined #lisp
<Shinmera> copy-file copies a file from a source to a destination.
<jmercouris> Does my question make sense or am I misunderstanding the approach?
<Shinmera> You need to tell it where to put it
<jmercouris> Right, so I would still need somehow to know the tree structure of the dir I'm copying over
<_death> for some settings you may want tar, or rsync...
<jmercouris> so I'd have to walk it
<Shinmera> No?
<Shinmera> The structure is in the path
billitch has quit [Ping timeout: 240 seconds]
<Shinmera> You truncate off the common path to make it relative, then make it absolute to the destination directory again. Then use ensure-directories-exist to make sure the folders are there, then copy.
nopf has joined #lisp
<jmercouris> That's true, but unless there's a copy-file flag that will construct all the necessary folders to get to a path, I'd still need to somehow do some processing no?
<jmercouris> ah okay, so there is a flag
<jmercouris> ensure-directories-exist
<Shinmera> No?
<Shinmera> That's a function
<Shinmera> clhs ensure-directories-exist
<jmercouris> :D
<jmercouris> Today is not my day :D
<Xach> This is an area that is full of little details and implementation variations.
<jmercouris> Shinmera: It is a clever approach, I now get it
<Xach> For example, getting a list of relative pathnames via DIRECTORY on a given base directory has a pitfall to carefully avoid.
<Shinmera> Yeah, might do symlink resolution or truenaming, so your paths might not all have the same root.
<Xach> if the base pathname isn't a truename, the results from DIRECTORY won't be amenable to enough-namestring.
* _death wonders why that snippet didn't give him a warning as it's missing a symbol in import-from
<jmercouris> In a different way, I've been convinced that rsync is the better tool here :D
<Xach> directory is specified to do truenaming
<jmercouris> would be a nice utility for someone to write though, or nice to have in uiop like uiop:copy-dir
<Shinmera> Oh, right.
smurfrobot has joined #lisp
<Xach> It sure would be nice to have a utility like that. I can understand why it's hard to get right, though.
<Shinmera> filesystem-utils is on my todo
<Shinmera> maybe in a decade I'll get to it :)
solyd has quit [Quit: solyd]
smurfrobot has quit [Remote host closed the connection]
<jmercouris> Shinmera: I'll look forward to it around 2028, setting a cal reminder now :D
BitPuffin has joined #lisp
smurfrobot has joined #lisp
saemcro has quit [Remote host closed the connection]
fikka has joined #lisp
SaganMan has joined #lisp
<Shinmera> I said maybe
Ven`` has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
smasta has joined #lisp
JuanDaugherty has joined #lisp
smasta has quit [Ping timeout: 240 seconds]
Ven`` has joined #lisp
FreeBirdLjj has joined #lisp
AxelAlex has quit [Quit: AxelAlex]
random-nick has joined #lisp
lexa_ has quit [Ping timeout: 255 seconds]
smurfrobot has quit [Remote host closed the connection]
markong has joined #lisp
eivarv has joined #lisp
SaganMan has quit [Ping timeout: 260 seconds]
sjl has joined #lisp
shrdlu68 has joined #lisp
mejja has joined #lisp
eivarv has quit [Quit: Sleep]
EvW has quit [Ping timeout: 240 seconds]
Cymew has quit [Remote host closed the connection]
Ven`` has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
random-nick has quit [Remote host closed the connection]
random-nick has joined #lisp
Cymew has joined #lisp
rumbler31 has joined #lisp
Ven`` has joined #lisp
jmercouris has quit [Ping timeout: 248 seconds]
varjag has quit [Quit: ERC (IRC client for Emacs 24.5.1)]
smasta has joined #lisp
_cosmonaut_ has quit [Ping timeout: 240 seconds]
<rumbler31> good morning lisp!
Cymew has quit [Ping timeout: 240 seconds]
<beach> Hello rumbler31.
<rumbler31> whats good today?
<beach> The weather is not too shabby.
<Xach> The Quicklisp build RSS feeds are live
<rumbler31> not bad on the east coast of the US, waiting for it to make up its mind about the cold
<Xach> i added the rss generator to quicklisp, too
smasta has quit [Ping timeout: 260 seconds]
<rumbler31> oh sweet!
<Xach> it is very simple and dumb but sufficient for some tasks
m00natic has quit [Ping timeout: 268 seconds]
randomstrangerb has quit [Ping timeout: 260 seconds]
* JuanDaugherty is only wanting to destroy all humongs by merciful means, does that count as a good day?
terpri has quit [Ping timeout: 256 seconds]
randomstrangerb has joined #lisp
DeadTrickster has quit [Read error: Connection reset by peer]
<pjb> JuanDaugherty: Patience, Last Judgement is near.
DeadTrickster has joined #lisp
<JuanDaugherty> pjb, ah good
damke_ has joined #lisp
damke has quit [Ping timeout: 265 seconds]
dec0n has quit [Read error: Connection reset by peer]
fisxoj has joined #lisp
<Xach> borodust: claw does not build for me
Karl_Dscc has joined #lisp
dyelar has joined #lisp
<borodust> Xach: what is reported?
eminhi has joined #lisp
randomstrangerb has quit [Ping timeout: 256 seconds]
<dlowe> I need to mess up my projects so I can get some activity on my feed :D
<borodust> Xach: woops, thank you, gonna fix that in a few hours
<Xach> ok
randomstrangerb has joined #lisp
cmatei has quit [Ping timeout: 264 seconds]
Ven`` has quit [Ping timeout: 240 seconds]
<paule32> hello
<paule32> need help: https://pastebin.com/CXEcd1Gw
<paule32> i get SYSTEM::%STRUCTURE-REF error
Karl_Dscc has quit [Remote host closed the connection]
<paule32> in line 147
smurfrobot has joined #lisp
cmatei has joined #lisp
Murii has joined #lisp
brendyn has quit [Ping timeout: 264 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
shka_ has joined #lisp
Mon_Ouie has joined #lisp
FreeBirdLjj has joined #lisp
<rumbler31> if you remove that line what happens
<rumbler31> paule32:
Ven`` has joined #lisp
smurfrobot has quit [Remote host closed the connection]
<paule32> rumbler31: the same
fikka has quit [Ping timeout: 256 seconds]
<rumbler31> what if you remove all setf wire-in calls
aindilis` has joined #lisp
<paule32> the same
windblow has quit [Quit: windblow]
smasta has joined #lisp
aindilis has quit [Ping timeout: 240 seconds]
<rumbler31> your full addder takes i1 i2 i3 as inputs
FreeBirdLjj has quit [Ping timeout: 240 seconds]
<rumbler31> but uses a b c
smasta has quit [Ping timeout: 240 seconds]
<pjb> function used princ to convert a port number to a string… This can be considered a bug, but in any case, it should be documented!
<pjb> beach: I have a suggestion for sicl (and really, for all CL implementations): annotate the function with the special variables used, and issue warnings or print notices about them (systematically and automatically). Notably, for implementation operators. Again this week somebody in #ccl had a problem that a ccl function to open a network stream failed, when *print-base* or *print-radix* were different from the default value; thi
<beach> "annotate" as in write it in the documentation and in the docstring?
<Shinmera> pjb: signals would also be good to know about
<Shinmera> and tags, though they're seldom used.
orivej has joined #lisp
<Shinmera> A compiler could actually also provide that kind of information automatically.
FreeBirdLjj has joined #lisp
<scymtym> doesn't SWANK:WHO-{BINDS,REFERENCES} basically provide that?
<beach> Sounds like good information to have.
<scymtym> well, ok, it would have to work the other way around for the above purpose
mepian has joined #lisp
flamebeard has quit [Quit: Leaving]
Ven`` has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
fikka has joined #lisp
turkja has quit [Ping timeout: 240 seconds]
terpri has joined #lisp
Jesin has joined #lisp
smurfrobot has joined #lisp
fikka has quit [Ping timeout: 248 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
<pjb> beach: by annotate here I mean in the compiler data structures. So that it may issue the warnings or write notices on its output.
<pjb> like a type annotation/type inference.
<pjb> If a function calls a function using dynamic variables, then it uses them itself too.
<beach> I think I would need an example. Maybe I am just tired after a long day of work.
pilfink has quit [Ping timeout: 240 seconds]
<makomo> hello
<rumbler31> paule32: in half adder you also setf a and b, but take in i1 and i2. I don't think these would explain your errors though, since a,b,c are globals, but maybe the fact that they are special is messing things up
<beach> Hello makomo.
<tfb> pjb: you can't always know this of course, but that doesn't invalidate the idea
cmatei has quit [Ping timeout: 248 seconds]
<makomo> pjb: hmm, why would you need to document it if it's only used internally by the function?
* beach again feels that everyone understand except him. :(
<makomo> if we suppose that the function correctly binds *print-radix* and w/e it needs before PRINC-ing
FreeBirdLjj has joined #lisp
cmatei has joined #lisp
smasta has joined #lisp
megachombass has joined #lisp
<megachombass> good news, i have 2 days extensions for my clisp toy compiler
<megachombass> if i manage to compile fibo (means be able to compile constants, a defun and a IF) ill be good
<rumbler31> -.-
<pjb> beach: something like: https://pastebin.com/Vqk3YQQP
<shrdlu68> megachombass: Are you using "clisp" as an abbreviation for Common Lisp?
smurfrobot has quit [Remote host closed the connection]
<megachombass> yes
<beach> pjb: Ah, yes, I see. I will definitely give it some thought.
<pjb> beach: additionnal similar annotations could be about side effects: mutation of bindings, mutation of lisp objects, and mutation of external state (file system).
Chream_ has joined #lisp
<shrdlu68> megachombass: You'd be better of using "CL" instead. clisp means something different to most people here.
<beach> pjb: Yes, I think I get the picture.
<pjb> beach: the problem being that programmers have a mental image of what state is used or mutated by functions, but it is not always exact (eg. a lot of *print-…* variables are ignored for non-I/O functions…), and it's in general unknown for implementation specific functions.
<beach> Sounds right.
Chream_2 has quit [Ping timeout: 256 seconds]
<pjb> makomo: yes, indeed if there is a local dynamic binding of a dynamic variables used by a function, then it can be removed from the list of dynamic variables usedby the caller.
<pjb> So a with-standard-io-syntax would inhibit all those *print-…* variable notices.
<pjb> Currently, we get this kind of warning only for undefined global dynamic variables.
FreeBirdLjj has quit [Ping timeout: 240 seconds]
<makomo> megachombass: clisp happens to be the name of a particular cl implementation. that's why you should use "cl" instead when referring to common lisp as a language
EvW has joined #lisp
<megachombass> oh i see
<megachombass> though it was the same
<Shinmera> or just "lisp"
<pjb> megachombass: it's easy, Common Lisp comes from a package named "COMMON-LISP" and with a nickname "CL". So call it common-lisp or cl.
<pjb> "LISP" was an old, pre-standard nickname. This is why #lisp is #lisp and not #cl or #common-lisp :-)
smurfrobot has joined #lisp
<pjb> beach: (dynamic-variable-used-by-function 'concatenate) -> (*debugger-hook* …) assuming it signals type errors, and signal calls invoke-debugger which uses *debugger-hook* ;-) See the range of the problem…
<beach> Yes, I see.
<pjb> perhaps the result will be that all functions always use indirectly all the standard dynamic variables. :-(
<beach> It would have to be given some thought.
Chream_ has quit [Ping timeout: 256 seconds]
smurfrobot has quit [Ping timeout: 240 seconds]
eivarv has joined #lisp
varjag has joined #lisp
fisxoj has quit [Quit: fisxoj]
fisxoj has joined #lisp
fikka has joined #lisp
Chream_ has joined #lisp
smurfrobot has joined #lisp
smasta has quit [Ping timeout: 260 seconds]
fikka has quit [Ping timeout: 264 seconds]
Arcaelyx has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
_cosmonaut_ has joined #lisp
smurfrobot has quit [Ping timeout: 240 seconds]
asarch has joined #lisp
ebzzry has quit [Ping timeout: 264 seconds]
alexmlw has joined #lisp
moei has joined #lisp
hhdave has quit [Ping timeout: 268 seconds]
fikka has joined #lisp
varjag has quit [Ping timeout: 252 seconds]
osune has joined #lisp
fikka has quit [Ping timeout: 268 seconds]
shifty has joined #lisp
varjag has joined #lisp
_cosmonaut_ has quit [Remote host closed the connection]
Amplituhedron has quit [Read error: Connection reset by peer]
fikka has joined #lisp
mepian has quit [Read error: Connection reset by peer]
varjag has quit [Ping timeout: 256 seconds]
spoken-tales has joined #lisp
smurfrobot has joined #lisp
eivarv has quit [Quit: Sleep]
fikka has quit [Ping timeout: 256 seconds]
varjag has joined #lisp
fikka has joined #lisp
eminhi has quit [Ping timeout: 240 seconds]
Karl_Dscc has joined #lisp
EvW has quit [Ping timeout: 246 seconds]
drewc_ has joined #lisp
smurfrobot has quit [Ping timeout: 256 seconds]
voidlily has quit [Read error: Connection reset by peer]
varjag has quit [Ping timeout: 268 seconds]
drewc has quit [Ping timeout: 260 seconds]
voidlily has joined #lisp
mepian has joined #lisp
varjag has joined #lisp
smurfrobot has joined #lisp
dieggsy has joined #lisp
spoken-tales has quit [Remote host closed the connection]
varjag has quit [Ping timeout: 264 seconds]
smurfrobot has quit [Ping timeout: 264 seconds]
fikka has quit [Ping timeout: 240 seconds]
zazzerino has joined #lisp
drewc_ is now known as drewc
scymtym has quit [Ping timeout: 252 seconds]
nullman has quit [Ping timeout: 256 seconds]
karswell has joined #lisp
nullman has joined #lisp
varjag has joined #lisp
fikka has joined #lisp
varjag has quit [Ping timeout: 248 seconds]
loli has quit [Ping timeout: 240 seconds]
<phoe> pjb: is https://github.com/informatimago/lisp/tree/master/common-lisp licensed under GPLv2 or GPLv2+?
<phoe> I see a file called GPL there that confuses me, because the main README states that the project is AGPLv3 with exceptions.
<jackdaniel> GPLv2+ (according to file GPL)
<megachombass> so, do you guys see any useless code, reduntant code, or better way to do things here? https://codepaste.net/aspmng
<jackdaniel> it is enough to search in the license string "at your option"
<jackdaniel> ah, no, GPL is whole license verbatim
<jackdaniel> nvm me
fikka has quit [Ping timeout: 248 seconds]
<beach> megachombass: You haven't made any of the modifications I told you to.
<megachombass> not on this one
<megachombass> i did on the other one
<megachombass> i'll fix parentehsis, whitespaces and aestetic things on this one later
<jackdaniel> megachombass: do them before presenting code here
<jackdaniel> this is waste of everyone time if we click that link and decide, that it's not formatted correctly and point that out *again*
<megachombass> now i want to know if there is useless code, or things that can be modified
moriarty has joined #lisp
<beach> megachombass: You don't get it do you?
<megachombass> yeeeeeeeeeeeeeeeeeeessss i do, for real
<megachombass> im going to do it, promised
<jackdaniel> I think that you need to understand: formatting your code and aesthetics is a *prerequisite*, not an addendum
<jackdaniel> for free peer review on irc
<beach> You are supposed to do it before submitting the code, because otherwise, you put additional burden on the people you are asking for help. That is so incredibly rude, especially since you have been told this already.
moriarty has left #lisp [#lisp]
<Bike> i thought this assignment thing was due today
<megachombass> i did send the virtual machine
jmercouris has joined #lisp
<megachombass> but i need a simle compiler that compiles fibo and fact
fikka has joined #lisp
<megachombass> the code i just pasted does that role
Cymew has joined #lisp
<beach> megachombass: See if from my point of view. You come here and ask for improvements. I spend time and energy on you. Then you completely ignore what I told you, and submit crappy code again. What makes you think I would want to help you again?
<beach> megachombass: Or any other person who has followed this exchange for that matter.
<megachombass> https://codepaste.net/y6mtwn whitespaces removed, parenthesis on the right lines.
<megachombass> tho there was something you told me about function naming
<beach> Incorrectly indented, still whitespace before ).
<megachombass> oh? let me recheck my bad
<beach> You really don't get it.
<beach> Did you use SLIME-indentation to indent it?
<beach> If you did it manually, it is always going to be wrong.
<megachombass> let me download slime
varjag has joined #lisp
Cymew has quit [Ping timeout: 240 seconds]
<beach> Anyway, good luck. I am off to spend time with my (admittedly small) family.
<megachombass> okey, have a nice evening beach!
ghard` has joined #lisp
<phoe> megachombass: for a pretty portable package for editing Lisp, you can try Portacle
ghard has quit [Remote host closed the connection]
<phoe> it contains emacs + sbcl + slime + git in a pretty nice package that should work out of the box
<megachombass> downloadin
fikka has quit [Ping timeout: 240 seconds]
fikka has joined #lisp
varjag has quit [Ping timeout: 256 seconds]
<jmercouris> phoe: +1 on the portacle reccomendation, always very easy for a beginner to get set up in this way
<jmercouris> unless they are already an emacs user, in which case they should be able to figure it out (assuming they didn't just install spacemacs and call it a day...)
mepian has quit [Ping timeout: 240 seconds]
Chream_ has quit [Ping timeout: 256 seconds]
Cymew has joined #lisp
drewc_ has joined #lisp
asarch has quit [Quit: Leaving]
fikka has quit [Ping timeout: 240 seconds]
<megachombass> hum
<megachombass> have put my code in portacle
<megachombass> selected all the code
<megachombass> and used the lisp-interactions
<megachombass> zero changes
<Fade> I used portacle to drag a handful of windows devs along on a lisp 'show and tell' a few weeks ago.
<Fade> it was so nice just to install it and run, instead of spending an hour getting everybody's systems up to snuff.
<phoe> megachombass: your buffer is in lisp-mode, right?
<phoe> if yes, then M-x indent-region
<jackdaniel> it's the fact that it is a hell lot easier to point someone at portacle than scare him with: install emacs, install slime, install sbcl, go to quicklisp and install it, configure stuff
<phoe> ^
<jackdaniel> (but it's still emacs, so that particular someone will probably have a trauma either way)
drewc has quit [Ping timeout: 240 seconds]
<megachombass> M-x, M stands for?
<megachombass> thats why i never used emacs, even copy paste is so different than everything else
Cymew has quit [Ping timeout: 252 seconds]
<jackdaniel> exactly my point ;-) M-x means Alt+x
<jackdaniel> C-x means Ctrl+x
<jackdaniel> (by Alt I mean left alt)
<megachombass> let me try alt xc
<megachombass> alt+x*
<megachombass> hum
<megachombass> so
<megachombass> opened it
<megachombass> copy pasted the code
<megachombass> selected all code
<megachombass> pressed alt+x
<megachombass> didnt see any difference.
fikka has joined #lisp
<phoe> megachombass: alt+x tells Emacs to accept a typed command.
<jackdaniel> what did you expect from M-x combination? it is used to trigger a command
<phoe> push alt+x and then write, "indent-region".
<megachombass> oh
<megachombass> oh
<megachombass> okey
<phoe> it should appear in the line on the bottom of the screen, called a minibuffer.
<phoe> then hit Enter, and it should work.
<jackdaniel> megachombass: try Ctrl+h Ctrl+t for in-browser tutorial which will show you how to work with emacs on basic level
<megachombass> yep, it indented now
raynold has joined #lisp
<phoe> megachombass: awesome. `C-x h` for selecting everything, M-w for copying it.
jmercouris has quit [Ping timeout: 240 seconds]
<phoe> And pastebin it to us.
<megachombass> control x and h does something weird
varjag has joined #lisp
<megachombass> it openend me a key translation menu
<phoe> welp. should not do it.
<phoe> C-g to exit.
Cymew has joined #lisp
<phoe> C-g is the most handful command in Emacs, it's basically, "get me out of here".
<megachombass> even after a control G
<megachombass> that menu still open, and when i do control+x+h it doesnt select my text
<phoe> oh, it's a second window. Switch to it, C-x 0
<warweasle> C-g = Esc-Esc-Esc-Esc-Esc-Esc-Esc-Esc-Esc-Esc-....
<phoe> It's `C-x h`, not `C-x-h`.
loli has joined #lisp
<megachombass> whats the difference between c-x h and c-x-h
loginoob has joined #lisp
<phoe> megachombass: `C-x h` means, "press C-x first, THEN press h`.
<megachombass> god bless
<phoe> no problem
Cymew has quit [Ping timeout: 240 seconds]
varjag has quit [Ping timeout: 256 seconds]
<megachombass> i start to understand the emacs, first thing i will do before even learn more about lisp , will be how to handle this editor
<loginoob> I installed sbcl and loaded quicklisp.lisp. Then i did this (quicklisp-quickstart:install) and (ql:add-to-init-file) and (ql:quickload "quicklisp-slime-helper")
smasta has joined #lisp
<phoe> megachombass: you are in a tough spot.
<loginoob> And after that i added (load (expand-file-name "~/quicklisp/slime-helper.el")) and (setq inferior-lisp-program "sbcl") to ~/.emacs file
Cymew has joined #lisp
<phoe> learning Lisp is not easy, learning Emacs is not easy, learning both at the same time is (not easy)²
<loginoob> but M-x slime gives me No-match
<jackdaniel> close emacs and start it again
pjb has quit [Ping timeout: 240 seconds]
<megachombass> everying this is so hard in this low level programming environment
<zazzerino> megachombass: Looks nice. Don't forget to move the parens at the end of your compilation-appel function so there's no whitespace before them and put a blank line after is-cas.
<loginoob> jackdaniel: I did that
loli has quit [Ping timeout: 260 seconds]
<megachombass> now i've just felt in love with visual studio xd
<zazzerino> and I'd be careful calling emacs a "low level" environment on #lisp :)
<megachombass> okey zzaz. but what about code itself, what is useless ,and what can i change?
<jackdaniel> low-level virtual machine for editing lisp ,p
<JuanDaugherty> cl and emacs are not tied at the hip
<dlowe> except for code formatting
<phoe> loginoob: if you want an easy to set up environment for editing Lisp, try Portacle
<phoe> (incf dlowe)
<zazzerino> megachombass: I don't have time to look at it. There are several people more knowledgable than myself here- I just wanted to get you to format your code correctly so they might actually be inclined to look at it!
<phoe> I need to run for now
<phoe> will be back in an hour
<dlowe> that's why I think a stand-alone CL formatter might be a good thing to have
<phoe> megachombass: if you still need review by then, tell me
<phoe> dlowe: I think beach is working on one
<dlowe> oh? cool, than I can just let him do it.
<phoe> beach: ^ can you tell us more about its current state?
* dlowe likes to delegate.
<megachombass> okey well i will be back in one hour then
damke has joined #lisp
<megachombass> hope pjb will be here too, he helped me out so much for the virtual machine
Cymew has quit [Ping timeout: 246 seconds]
<dlowe> but emacs could call out to the formatter instead of having it built into slime
<loginoob> No i want to know what am i doing wrong
voidlily has quit [Read error: Connection reset by peer]
Cymew has joined #lisp
<loginoob> In this line (setq inferior-lisp-program "sbcl") should i give path as to where sbcl is installed?
damke_ has quit [Ping timeout: 264 seconds]
<dlowe> loginoob: did you restart emacs when you modified your .emacs file?
damke__ has joined #lisp
kokonaisluku has joined #lisp
mepian has joined #lisp
<loginoob> dlowe: I modified .emacs file by gedit
<dlowe> loginoob: that doesn't answer my question
<loginoob> dlowe: Yes i restarted the emacs after that
<megachombass> yesterday they told me about remplacing gensym by memsym, but i dont find memsym in the doc?
pjb has joined #lisp
fikka has quit [Ping timeout: 248 seconds]
voidlily has joined #lisp
<dlowe> loginoob: I'll help you in private message
damke has quit [Ping timeout: 264 seconds]
smasta has quit [Ping timeout: 260 seconds]
Cymew has quit [Ping timeout: 268 seconds]
Cymew has joined #lisp
<phoe> megachombass: wait a sec, what is memsym?
<phoe> I have no idea what it is and it is not a part of the CL standard
<megachombass> i dont know, one of you told me that gensym was trash
<megachombass> and to replace it with memsym (or something similar)
smurfrobot has joined #lisp
<Bike> there is no previous mention of 'memsym' in the log for this channel.
<phoe> gentemp?
<phoe> that's what I see
<phoe> 2018-01-25T22:16:05Z pjb: megachombas: you can use gentemp instead of gensym to generate interned temporary symbols so you don't have this problem with the textual representation.
ghard has joined #lisp
ghard has quit [Client Quit]
Cymew has quit [Ping timeout: 240 seconds]
<megachombass> dunno why i read memsym
<megachombass> btw, how do you see channel logs?
<Bike> there are two in the topic.
Sauvin has quit [Read error: Connection reset by peer]
smasta has joined #lisp
damke has joined #lisp
JuanDaugherty has quit [Quit: Ex Chat]
voidlily has quit [Remote host closed the connection]
damke__ has quit [Ping timeout: 264 seconds]
smasta has quit [Ping timeout: 240 seconds]
voidlily has joined #lisp
dieggsy has quit [Quit: ERC (IRC client for Emacs 27.0.50)]
zazzerino has quit [Remote host closed the connection]
Cymew_ has joined #lisp
Cymew_ has quit [Ping timeout: 252 seconds]
dan64- has joined #lisp
kamog has joined #lisp
random-nick has quit [Remote host closed the connection]
dan64 has quit [Ping timeout: 264 seconds]
dan64 has joined #lisp
Cymew has joined #lisp
dan64- has quit [Ping timeout: 252 seconds]
<pjb> phoe: Well, there's a GPL v2 file in the repository, but the file headers specifies in general AGPL3. The later is autoritative. There may be a couple of files with a different license for contribution reasons. Notice that you may find an old release (of part of it) with a different license too. It's not maintained or supported.
fikka has joined #lisp
Cymew has quit [Ping timeout: 268 seconds]
<pjb> phoe: I shall indicate in the README that the default license is AGPL3, and update the license file…
<pjb> phoe: you can also notice that the asd file contains a :license property set to "AGPL3".
Cymew has joined #lisp
smurfrobot has quit [Remote host closed the connection]
Poeticode is now known as ImoutoCodes
<pjb> megachombass: in http://prntscr.com/i61mwj you may notice that after you typed C-g, the minibuffer (bottom row of the emacs frame) shows "Quit". This is the sign that C-g was successful and emacs is ready for the next commands.
<pjb> megachombass: in emacs, you're led to watch out for status and messages at the bottom of the windows and the bottom of the frame.
<phoe> pjb: yes, I supposed that AGPL3 was the proper thing. I was confused by the lone GPL file containing GPL2 though.
<pjb> megachombass: this is to stay consistent with interface on terminals, where the last line output (and the status line when a terminal is able to display one) is usually on the bottom.
<pjb> phoe: It needs updating, that's all.
ImoutoCodes is now known as Poeticode
fikka has quit [Ping timeout: 248 seconds]
<phoe> pjb: gotcha.
eivarv has joined #lisp
Cymew has quit [Ping timeout: 264 seconds]
<pjb> megachombass: concerning channel logs, you can download them all from http://ccl.clozure.com/irc-logs/lisp/ and read them so you'll know all that have been discussed (and learn a lot of things) since ever in #lisp! Similarly, you may be able to find archives of news:comp.lang.lisp and learn a lot (best parts from 1995 to 2010).
<pjb> megachombass: then, you may also want to read the AIM (AI-Lab Memos), and other TR (Technical Reports), to learn all about the history of lisp and artificial intelligence; we have complete historical tracks from the 1950s…
<megachombass> tbh i really want to learn lisp, because its quite challenging for me
pilfink has joined #lisp
Mon_Ouie has quit [Ping timeout: 240 seconds]
<megachombass> i feel like a complete idiot to have to ask questions in every step i do in this language
Poeticode is now known as solidcode
Cymew has joined #lisp
nullman has quit [Ping timeout: 256 seconds]
Chream_ has joined #lisp
damke_ has joined #lisp
<pjb> megachombass: it's customary to use an explicit T as condition in the last clause of COND: (cond … (t `(function ,(car exp)) (compilation-appel exp env fenv nomf)))
<megachombass> so basicly i can remove that t right?
<_death> ugh, asdf tries to educate everyone by signaling these silly warnings :(
<pjb> No, basically you should add it!
<megachombass> oh, wait let me check
solidcode is now known as Poetifox
Cymew has quit [Read error: Connection reset by peer]
<pjb> megachombass: if you remove it, it works only if you have a single expression in the clause. But cond clauses accept multiple expressions!
Cymew has joined #lisp
<pjb> (cond (`(foo) (print 'bar) 'baz)) #| prints: bar --> baz |#
<pjb> (cond ((print nil) (print 'bar) 'baz)) #| prints: nil --> nil |#
<pjb> (cond (t (print nil) (print 'bar) 'baz)) #| prints: nil and bar --> baz |#
damke has quit [Ping timeout: 264 seconds]
<pjb> so the presence of this t matters.
<pjb> but indeed, (cond (t e)) and (cond (e)) are equivalent. (as long as the clause is the last in the cond).
<megachombass> oh, i see
<pjb> It's clearer for the human reader, to write the T explicitely, as it demonstrate that this is exactly what you want, and not an error.
<_death> do I as a user really need to care that some library has an invalid :version specifier or that it defines a foo-tests system isn't named foo/test.. does asdf really has to bother users with such things..
<pjb> megachombass: it's like, () '() nil 'nil and (list) (amongst other), when evaluated, all return the same thing, CL:NIL.
<pjb> megachombass: but there are conventions about them: () is an empty list in source (not evaluated). '() is an empty list expression (evaluated).
<phoe> but it's preferable to write NIL if it's meant to be used a boolean, () if it is not e---
<phoe> exactly what pjb said there
<megachombass> roger that, so always put a T on the conds
<jasom> T all the conds!
<phoe> megachombass: if you want to execute an "otherwise" clause - yes, do it.
<pjb> nil is the boolean false. 'nil is the symbol CL:NIL. (list) is the creation of a new empty list (all empty lists are the same CL:NIL symbol, but sometimes you may want to stress you're creating lists, so you'd use (list) instead of just '()).
nullman has joined #lisp
<phoe> otherwise your COND will just return NIL.
<loginoob> Is there a comparison as to why learn Lisp over Haskell
<phoe> which may be what you want.
<phoe> loginoob: one second
fikka has joined #lisp
<pjb> loginoob: no, because you should learn both!
<pjb> loginoob: notice also there's liskell ;-) (once you know both lisp and haskell, you merge them).
<phoe> “APL is like a beautiful diamond - flawless, beautifully symmetrical. But you can’t add anything to it. If you try to glue on another diamond, you don’t get a bigger diamond. Lisp is like a ball of mud. Add more and it’s still a ball of mud - it still looks like Lisp.”
<phoe> this quote applies just as well to Haskell instead of APL
random-nick has joined #lisp
<phoe> these two languages are pretty damn different, too. Haskell is purely functional with a stress on this paradigm, while Lisp is multi-paradigm with a stress on allowing the programmer to program however they want.
<_death> loginoob: do you also go to churches and ask them about islam
<jackdaniel> XYZ* is like a ball of snow. [*] - put your favourite lisp dialect here
<phoe> _death: no better place to ask about Lisp than on #lisp
<jackdaniel> made of crystals still behaving like a mud ;-)
dieggsy has joined #lisp
<loginoob> _death: I can. And they should have a resonable answer I think.
<megachombass> what more can be done there pjb?
<_death> phoe: don't see that this question is about lisp
<pjb> megachombass: have you read the paste I prepared yesterday?
<megachombass> yes, but the paste was about the VM
<megachombass> now its about the compiler
<pjb> megachombass: it was about everything!
Cymew_ has joined #lisp
<borodust> Xach: fixed problem with claw
<megachombass> there was about changing the structure of the vm etc, making it like a struct instead of just setting variables.
<megachombass> but the compiler is independant of the VM
<ebrasca> phoe: I have lear lisp and emacs at the same time and it is not hard.
<pjb> megachombass: this paste: https://pastebin.com/7pTwi9fh
varjag has joined #lisp
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
warweasle has quit [Quit: rcirc on GNU Emacs 24.4.1]
<borodust> Xach: i see bodge-chipmunk generates some style-warnings, gonna check if i can remove those
Cymew has quit [Ping timeout: 256 seconds]
<pjb> megachombass: for example, instead of worrying about gensym/gentemp, etc, you would just use a generate-label function everywhere you need a new label. Then you can modify the generate-label function to use whatever you want to create a label.
<borodust> (missing aliens/foreign functions)
<megachombass> well, i havent sent the VM yet
<megachombass> im going to try to apply whats specified on that paste
<megachombass> coming back
Cymew_ has quit [Ping timeout: 252 seconds]
Cymew has joined #lisp
Cymew has quit [Read error: Connection reset by peer]
Cymew has joined #lisp
<_death> worse yet, these asdf warnings are simple-warnings so cannot be selectively muffled..
Cymew has quit [Ping timeout: 268 seconds]
loli has joined #lisp
Arcaelyx has joined #lisp
foom2 has joined #lisp
Cymew has joined #lisp
smurfrobot has joined #lisp
foom has quit [Ping timeout: 276 seconds]
JonSmith has quit [Remote host closed the connection]
loli has quit [Ping timeout: 256 seconds]
atgreen has joined #lisp
JonSmith has joined #lisp
Cymew has quit [Ping timeout: 256 seconds]
Cymew has joined #lisp
<Xach> borodust: some style-warnings aren't worth the trouble, but some are - not sure which is the case in claw
<borodust> Xach: some missing foreign functions in the compiled blob, does not affect main functionality, but i'm working on fixing those anyway
Amplituhedron has joined #lisp
Cymew has quit [Ping timeout: 260 seconds]
Cymew has joined #lisp
<borodust> this basically means i compiled chipmunk w/o some functions for some reason (probably missing custom config or whatnot)
fikka has quit [Ping timeout: 240 seconds]
Cymew has quit [Ping timeout: 260 seconds]
loginoob has quit [Quit: Page closed]
Cymew has joined #lisp
EvW has joined #lisp
<ebrasca> Hi
<ebrasca> I like to get opinions about my code : http://termbin.com/m1w7
fikka has joined #lisp
<Xach> ebrasca: I don't think you should have a struct slot that defaults to NIL but has an integer type.
<ebrasca> For now I don't know how te refactor : read-dir-from-cluster , remove-dir-from-cluster and write-metadata.
Cymew has quit [Ping timeout: 240 seconds]
<_death> but that's a limitation of defstruct.. so maybe the solution is to use defclass
<sjl> I usually do the equivalent of (slot-name (error "Required") :type (unsigned-byte 8)) to get around that annoyance
<ebrasca> Xach: I have done that to see if I am reading correctly from disk.
<Xach> ebrasca: loop to check for membership in a set of magic values would be better done with FIND or POSITION or MEMBER or similar.
<_death> ebrasca: looks like you actually want w-o-t-s in r-d-f-c instead of concatenate
<pjb> ebrasca: I would have written a macro to generate the defstruct, read-fat32 and write-fat32…
orivej_ has joined #lisp
<ebrasca> pjb: I have not think in formating disk , but i like to have 1 for write and read.
<pjb> ebrasca: it would be nice if it was independent from any underlying I/O system.
<pjb> Don't depend on mezzano or anything else.
<phoe> ^
<pjb> Instead, take as argument a vector of closures to perform this I/O; or define a CLOS protocol (a set of defgeneric function).
orivej__ has joined #lisp
loli has joined #lisp
<pjb> This way, your fat32 file system package could be used to read and write fat32 everywhere it's needed. (sd-cards, planetary sondes, embedded hardware, synthesizers, mezzano, etc).
<makomo> dependency injection! :D
Cymew_ has joined #lisp
<makomo> is passing a vector of closures a common thing?
<pjb> It's called an object in other languages.
<ebrasca> pjb: But I don't understand how to make it independent of mezzano I/O.
orivej has quit [Read error: Connection reset by peer]
<makomo> pjb: well, yeah, but how common is that "idiom"?
<pjb> Instead of calling mezzano.supervisor:disk-write, you would call (funcall (write-function disk) …)
<makomo> it feels a bit clunky
<pjb> makomo: it depends on what you write. In this case it's indicated.
Pixel_Outlaw has joined #lisp
<ebrasca> pjb: Maybe someone can make some portable disk-write.
<pjb> makomo: as I said, the detail doesn't matter much. It could be a single closure with a message parameter (but then you have to use &optional or &rest arguments). It can be a vector a list or even a structure containing closures. Or it could be a set of defgeneric function with an opaque object.
<makomo> ebrasca: he's just getting at the fact that you should abstract the writing to disk into, for example, a generic function
<Xach> makomo: i haven't seen it too awful much.
<pjb> ebrasca: For example, to access a FAT-32 virtual disk, you can just open a binary file, and implement disk-write using write-sequence!
orivej_ has quit [Ping timeout: 240 seconds]
<_death> that'd be nice for forensic tools..
<Xach> makomo: i've seen passing a chain of closures, but it just looks like a closure, like a list looks like a cons...
<Xach> e.g. cl-ppcre generates a chain/tree of closures from regular expressions text.
<makomo> ah i see, pretty cool
<ebrasca> Some tips to make 1 funtion from read-dir-from-cluster , remove-dir-from-cluster and write-metadata ?
<makomo> ebrasca: and then a concrete implementation of such a function would use mezzano or something
Cymew_ has quit [Ping timeout: 252 seconds]
<ebrasca> Xach: Do FIND or POSITION or MEMBER work on arrays with special structure?
Cymew has joined #lisp
<pjb> member not.
<phoe> ebrasca: special structure? what do you mean?
<pjb> the others only on vectors.
<stylewarning> ebrasca: what do you mean “special structure”
<stylewarning> ebrasca: the former two work on sequences
<ebrasca> each 32 octets is one dir
<ebrasca> if it is sort it is X and if it is part of long-name ...
<phoe> ebrasca: what is the element type of the vector?
<phoe> what kind of things do you want to put in the vector?
orivej__ has quit [Ping timeout: 240 seconds]
<ebrasca> It is vector/buffer/aarray of (unsigned-byte 8)
scymtym has joined #lisp
<pjb> ebrasca: this is a Heap management (an allocator with a garbage collector).
josemanuel has quit [Quit: leaving]
<pjb> ebrasca: it doesn't access the memory directly.
fikka has quit [Ping timeout: 240 seconds]
<phoe> ebrasca: so you have vectors of unsigned-byte 8s.
<pjb> ebrasca: instead, it uses a *gc-memory* object, and methods poke-uint64 peek-uint64 etc, to read and write the memory.
<phoe> FIND or POSITION will work on them.
<_death> ebrasca: find/position work on specialized arrays, and furthermore may have optimized variants for them
shifty has quit [Ping timeout: 240 seconds]
<pjb> ebrasca: so you can have an implementation using a lisp vector (cf. the file memory.lisp in the same directory), or you can use a FFI to peek and poke the actual memory of the process (eg. to store the heap in a memory mapped block, to share a heap of lisp objects with another process.
Cymew has quit [Ping timeout: 252 seconds]
<borodust> Xach: heh, found the issue (apparently, gcc was optimizing away some functions during linking :/)
<Xach> borodust: interesting!
<borodust> Xach: gonna wait for travis and appveyor builds to republish blobs
<ebrasca> _death: Now I like more w-o-t-s .
Chream_2 has joined #lisp
Murii has quit [Ping timeout: 256 seconds]
windblow has joined #lisp
<borodust> oh wow, that was fast... unexpectedly (macos build almost always takes ages)
defaultxr has joined #lisp
Chream_ has quit [Ping timeout: 256 seconds]
<borodust> Xach: fixed all warnings
fisxoj has quit [Quit: fisxoj]
<ebrasca> _death: ... I don't understand how to use with-output-to-string it output some stream .
smasta has joined #lisp
fikka has joined #lisp
<_death> ebrasca: you can use w-o-t-s in the code below ;; Read long name: (setf name (w-o-t-s (loop ... do (format the-stream ...))))
<ebrasca> makomo: What do you mean with dependency injection ?
<_death> ebrasca: but I'd split the function into smaller ones.. and try to avoid needless subseqs
<makomo> ebrasca: i think that's how java people usually call such a pattern. instead of explictily using some library/component in your library, delegate to the user the work of choosing the right component to use
<makomo> so the user has to provide, as a parameter, the component to use for w/e task
<pjb> modules should not depend on other modules, instead modules should take modules as parameters.
<pjb> This allows the toplevel program to decide what module should be used another module at run-time, instead of compilation-time.
<makomo> but i might be wrong. however, i don't see why that should be so special. it's kind of a central point when designing something that others will use
<pjb> Also this allows the use of multiple modules by the same module at run-time.
<makomo> with "others" being not only other people, but also other modules within the same system, etc.
<makomo> to me it's just the general notion of "not tightly coupling things"
<pjb> makomo: you still need to draw a line somewhere.
<_death> (defgeneric disk-write (backend ...)) then you can have a mezzano backend.. though it may prove too slow and then you need to try something else
<makomo> pjb: yeah, i guess
<pjb> _death: we're dealing with I/O here: nothing is too slow when compared with I/O!
<_death> pjb: you're assuming things about the backend ;)
<pjb> I'm assuming, indeed :-)
<pjb> No, but generic functions are not that slow.
<_death> right
Chream_2 has quit [Ping timeout: 256 seconds]
iqubic has joined #lisp
<_death> also, it may not be a good idea to defgeneric disk-write directly, because then you'd need to pass the backend all over.. this is a job for special variables.. so you can have (defun disk-write (... &key (backend *backend*)) (disk-write* backend ...)) .. this is a common pattern
<pjb> Now, it's faster to pass mandatory parameters.
<pjb> But you can see here that a set of closure may be the best solution.
<pjb> With closures you don't need to pass explicitely the additionnal parameter.
<_death> you could also dispatch differently (funcall (get *backend* 'disk-write) ...)
<_death> there are many ways ;)
<pjb> and now you have a O(n) function!
<_death> pjb: but n is practically constant :)
<_death> pjb: also it can be cached
<pjb> it's 4 in my current image, but it could be much bigger.
_mjl has quit [Ping timeout: 256 seconds]
alexmlw has quit [Quit: alexmlw]
<_death> there could be something like (defgeneric io-pattern (backend)) that returns the closures needed
<_death> erm, io-protocol
<_death> I've done this with https://github.com/death/constantia/blob/master/struct.lisp and it was useful at times
<pjb> Don't use dynamic variables if you can avoid them.
<pjb> This is a useless complication.
random-nick has quit [Remote host closed the connection]
<pjb> The point here is that dynamic = time; you would use dynamic variable if things changed in time. But when you work with a fat32 file system, you don't change the underlying storage mechanism periodically.
<pjb> You can have 2 fat systems each on its own storage. So the storage is a parameter of the fat system.
<_death> well, if you see it that way, why not just #+mezzano "mezzano-backend" in .asd ..
<pjb> mount -t fat32 /dev/sd3 <- clearly you see the parameters.
<pjb> Because it's a RUN-TIME parameter.
<pjb> mount -t fat32 image.fat32
attila_lendvai has quit [Ping timeout: 248 seconds]
<pjb> You should try to avoid #+/#- as much as dynamic variable, and much more in asd files.
<_death> write, there's asdf feature-testing support
<_death> *right
<sjl> _death: any chance of adding a specific license to https://github.com/death/constantia ?
<sjl> "you are
<sjl> welcome to use it, should you choose to" is a bit vague
<makomo> "Yes, the naming was inspired by the famous Alexandria library."
<makomo> my thought exactly :-)
<makomo> now we also need babilonia
<_death> meanwhile, quicklisp :verbose t reveals lots of bugs.. maybe :verbose should have a default of (< (random 1.0) *bugrevealing-probability*) ;)
Jesin has quit [Ping timeout: 240 seconds]
<_death> sjl: sure.. I'll add MIT license
<sjl> thanks
orivej has joined #lisp
smasta has quit [Read error: Connection reset by peer]
White_Flame has quit [Remote host closed the connection]
smasta has joined #lisp
<_death> sjl: done
<_death> erm, github says BSD-2-Clause.. now you know how I feel about licenses ;).. anyway, I'll push the correct one
<sjl> hah
<sjl> Might be good to put it in the .asd as well
<sjl> :license "MIT"
<_death> sjl: right
White_Flame has joined #lisp
shka_ has quit [Ping timeout: 240 seconds]
<sjl> I should probably split my utils library into separate files at some point
<sjl> The 3.2k line file is getting a little unwieldy
<_death> I have tons of utilities in other libraries.. I keep postponing their inclusion until I find that I need them in multiple cases
Posterdati has joined #lisp
<sjl> I mostly just dump them into my main util library, except for the mathy ones that start in my project euler repo's utils file and only graduate if I need them elsewhere.
<_death> but usually end up implementation different designs that require different utilities.. such is the way with "code as art" in personal projects
hhdave has joined #lisp
<_death> sjl: what about your other (public) projects.. for some reason I made sure my public ones don't depend on it
<sjl> anything I intend other people to use doesn't rely on my utils
<sjl> I only use my utils for personal stuff like games, etc
papachan has quit [Quit: WeeChat 2.0.1]
<sjl> I try to make my libraries depend on as little as possible. E.g. I love iterate, but use vanilla loop in my libraries.
<_death> I guess the reason is that I don't want it in quicklisp
<_death> sjl: yeah, I know what you mean
White_Flame has quit [Remote host closed the connection]
BitPuffin has quit [Remote host closed the connection]
ym has quit [Quit: Leaving]
<ebrasca> _death: My new version of concatenate part : http://termbin.com/lz1p
<_death> sjl: wrt iterate (or series, or loop wars) this has been resolved for me for several years now, since I internalized the One Function to a Function rule
<ebrasca> _death: No concatenate and subseq
<sjl> _death: "don't use iterate/loop at all, make and compose lots of small functions"?
<_death> sjl: the second half.. then the looping construct doesn't matter
White_Flame has joined #lisp
<_death> sjl: I use loop when it makes things clear
<iqubic> sjl: Isn't that the FP way of looking at things?
<ebrasca> _death: What do you think my new version?
<_death> ebrasca: you can have a local function that you call with the indices
<_death> ebrasca: (add 1 10) (add 14 25) (add 28 31)
<sjl> iqubic: that's usually part of it. "the FP way" can go further into things like "use pure functions whenever possible", but one-function-to-a-function is orthogonal to that
<iqubic> I know.
<sjl> "one function to a function" comes from https://groups.google.com/forum/message/raw?msg=comp.lang.lisp/9SKZ5YJUmBg/Fj05OZQomzIJ as far as I know
greaser|q has quit [Changing host]
greaser|q has joined #lisp
greaser|q is now known as GreaseMonkey
<ebrasca> _death: What do you mean?
atgreen has quit [Quit: atgreen]
nopolitica has joined #lisp
<ebrasca> _death: It have less bytes consed and less cpu cicles used.
megachombass has quit [Ping timeout: 260 seconds]
lnostdal has quit [Remote host closed the connection]
<dmiles> in CL must one ensure structures can be expected to be accessed by slot numbers or can just by name be sufficent?
mepian has quit [Ping timeout: 256 seconds]
<Bike> structures don't have numbers for slots.
<Bike> mop has a concept of slot locations, though
<Bike> mop slot-definition-location
<pjb> Bike: they can have: (defstruct (foo (:type vector)) …) !
<Bike> slot locations in that sense are nonnegative integers. so there's a number.
<pjb> dmiles: but ok, if you specify :type vector, no structure object is created, instead make-foo creates a vector and the foo- accessors access vector slots.
<pjb> dmiles: as an implementer the question you have to ask yourself with respect to structure objects, is whether you want to do redundant work, or whether you're happy in implementing (defclass structure-class (object-class) ()) and be done with it.
<pjb> (defclass structure-class (standard-class) ()) ; I mean.
<_death> Shinmera: found plaster-new a bit confusing, and there's no completion for type of paste (and no "lisp" type).. used plaster-paste-region
<ebrasca> _death: First time I read "/=".
fdfdf has quit [Ping timeout: 240 seconds]
mepian has joined #lisp
<pjb> dmiles: have a look at: com.informatimago.common-lisp.cesarum.utility:define-structure-class
<_death> ebrasca: there are still some issues (some introduced by me :).. code-char and perhaps use of the name "end" to denote the upper bound of the interval
dmiles has quit [Ping timeout: 256 seconds]
<ebrasca> _death: It work , at least I don't see any error.
<ebrasca> _death: Why your code lock better and is better?
<_death> ebrasca: I don't understand the question
<ebrasca> mmm
<_death> ebrasca: my version doesn't cons
<ebrasca> _death: How to make better code in performance and better to read?
<_death> ebrasca: (except by building the string)
<_death> ebrasca: my advice for performance is to profile first, and in general not to build structure just to throw it away unless it makes things clearer.. for the best style guide I know, http://norvig.com/luv-slides.ps
<phoe> ebrasca: make it run, make it right, make it fast
<phoe> in other words, optimize last.
zazzerino has joined #lisp
<ebrasca> I think I have done make it run for sertain set of FAT32.
<phoe> Do you have some kind of tests for your feature?
<ebrasca> Yes
<phoe> I find it very handy to have a set of tests that I can run. This way, I can detect some bugs when I modify my code later on.
<ebrasca> Down in coments
<phoe> Then you can use these tests to verify that your code stays correct between your changes.
<ebrasca> mmm
<phoe> You run your tests once, they pass.
<phoe> You make a change in your code to make it faster.
<ebrasca> It is more read some file the end.
<phoe> You run your tests again. If they fail, then you have surely made a mistake.
<_death> ebrasca: these tests btw you could uncomment and make functions test-x test-y
<ebrasca> I have never make automatic tests for someting.
<phoe> ebrasca: you should.
<phoe> They're a huge time-saver.
dmiles has joined #lisp
<dmiles> can someone message me what i missed?
<ebrasca> phoe: I remember I have ask you some day ago how to make automatic testing.
<dmiles> mop slot-definition-location
<ebrasca> phoe: Can I ask againg?
lnostdal has joined #lisp
<phoe> ebrasca: sure thing. There are multiple test frameworks in Lisp that you can use to write automated tests.
<ebrasca> phoe: It need to work with mezzano.
capitaomorte has joined #lisp
<phoe> For a very simple and short one, you can take a look at https://github.com/lmj/1am
Jesin has joined #lisp
<phoe> It is completely portable Common Lisp. It should work on Mezzano.
<dmiles> <Bike> slot locations in that sense are nonnegative integers. so there's a number. [14:23] Disconnected from freenode on Friday January 26th,2018 at 02:01pm. Server disconnect reason: hitchcock.freenode.net
Jesin has quit [Client Quit]
<phoe> dmiles: use the IRC logs?
<dmiles> thx
<ebrasca> phoe: Do you plan make some meting in krakow?
<_death> I think the RT testing framework is small and simple and used for decades :)
<phoe> ebrasca: not really.
<ebrasca> phoe: Do you plan to go to ELS?
<phoe> ebrasca: yes!
<ebrasca> phoe: wow , I don't know hot to go to ELS.
ACE_Recliner has joined #lisp
<phoe> ebrasca: pick your favorite travel vehicle to Marbela, Spain, and stay there for a few days.
tcr has joined #lisp
* ebrasca is in panic when he try to plan traveling to Spain alone.
Pixel_Outlaw has quit [Quit: Leaving]
<jackdaniel> Malaga is the closest airpoirt as far as I'm aware, and there are buses going out from there every hour 24h to Marbella
<jackdaniel> (I hope I didn't mix the details, but please recheck them)
<ebrasca> jackdaniel: I think I rememver you from lisp-pl or someting.
<jackdaniel> that may be the case, because I hang out there too
<ebrasca> jackdaniel: Do you know some fast and easy system for geting money?
Bike has quit [Ping timeout: 260 seconds]
EvW has quit [Ping timeout: 252 seconds]
<jackdaniel> stealing (given you have necessary skills), but it's not socially acceptable ;-)
osune has quit [Remote host closed the connection]
<dmiles> pjb: the define-structure-class is in terms of defcvlass .. correct?
<pjb> dmiles: yes.
<aeth> ebrasca, jackdaniel: Initial Coin Offering (ICO) seems to be the easiest way people make money these days
<pjb> It would have to be improved, and to deal with :type list and vector, but the point here is to show that structure-object can be a subclass of standard-object.
<aeth> ICOs are probably violating financial regulations, though.
<White_Flame> ebrasca: be attractive and stream video games
<aeth> Usually the easy money is in legal gray areas or everyone would be doing it.
<jackdaniel> ah, I'd forget, gambling is a way too (as aeth mentioned)
<jackdaniel> good night o/
<aeth> Games are even adding totally-not-gambling mechanics these days.
<aeth> jackdaniel: good night
<ebrasca> I am searching for some generous donor.
<dmiles> pjb: that indeed is what I am doing so i was trying to triage whther or not i created a list of slotnumbers to turn themseves into slotname .. i guess :type list and vector tells us to do it sonner than later
<dmiles> sonner/sooner
<pjb> right.
<aeth> There are some practical differences with how implementations handle structs that is probably reflected in the assumptions in Lisp code. :type is usually respected in defstruct, and :type is usually ignored in defclass (only CCL seems to do type checking in the latter)
<_death> I think SBCL also looks at :type in defclass
orivej has quit [Ping timeout: 256 seconds]
<aeth> And, of course, structs *might* be optimized.
<aeth> _death: Then that's new
<aeth> A while back I was using :type and only CCL would care. You can probably make CLOS always care, with the MOP.
<ebrasca> I like to ask about vulkan and mezzano.
<_death> in fact I had an attempt at a patch to help it report better errors https://github.com/death/sbcl/commit/4341538e3e4f62ae111fee2e657d5969322f6b02
<dmiles> i have no problem backing my structure with a vector or any sequence.. what i am missing is i've always assumeed there was also a get-slot-value-using-offset type function
<ebrasca> mmm better later.
damke has joined #lisp
LiamH has quit [Quit: Leaving.]
<dmiles> (since all the sub lisps like LarKC always has such a thing that works on any standard-object but definately on structures)
<dmiles> but this is not a normal mop protocal? that is a reief
<dmiles> relief
damke_ has quit [Ping timeout: 264 seconds]
tcr has quit [Ping timeout: 256 seconds]
<dmiles> n/m found it #'STANDARD-INSTANCE-ACCESS
JonSmith has quit [Remote host closed the connection]
JonSmith has joined #lisp
mishoo has quit [Ping timeout: 240 seconds]
<dmiles> I was plannig on storing a Layout at 0 but does that interfer with :type vector ?
pagnol has joined #lisp
z3t0 has joined #lisp
<aeth> _death: (defclass foo () ((bar :initform 0 :accessor bar :type (integer 0 10)))) (let ((foo (make-instance 'foo))) (setf (bar foo) 10f0) (bar foo)) ; works and returns 10.0 in SBCL, ECL, CMUCL, CLISP, and ABCL, but does not work in CCL because it's not of the correct type, with "Condition of type CCL:BAD-SLOT-TYPE"
<dmiles> well actualyl consider :type list i suppose they are doing that for some nefarious reason
<pjb> dmiles: it would.
defaultxr has left #lisp ["WeeChat 2.0.1"]
<pjb> dmiles: have you had a look at the way sicl implements objects?
<pjb> dmiles: vectors can be implemented as objects too, nothing prevents it.
z3t0 has quit [Remote host closed the connection]
<_death> aeth: safety 3
<aeth> Then that's useless for most code
<dmiles> pjb: a little bit.. i know it does what we are talking about.. in fact i am counting on some parts of the system jsut making vectors with Layouts at 0
lnostdal has quit [Ping timeout: 252 seconds]
<ebrasca> pjb: But objects are implemented in structures , I think they are.
<_death> aeth: I have a declaim for it in my .sbclrc, so not useless for me
<pjb> ebrasca: nope. in sicl structures are implemented as clos objects, and clos objects are implemented using two vectors IIRC.
<pjb> internal vectors.
<aeth> _death: I do get essentially the same error as in CCL when safety is 3.
<pjb> I don't remember if in sicl lisp vectors are implement as clos object, but I would do that, at least for not specialized vectors.
<aeth> (Even calling the type (mod 11))
<dmiles> pjb: oh right now this reminds me of my issue :P i impl vecotrs as clos objects ;P
<dmiles> pjb: i suppose vectors will take 2 vectors then
<dmiles> (at least for me)
<pjb> well, one of them is shared amongst all vectors of the same type.
<pjb> arrays, actually.
<dmiles> but the fact that they :type vector .. i am assuming they are trying to create a secario i already by fdefalt created thus they expected to have 0 slot free for their useage
fisxoj has joined #lisp
<dmiles> (if all my typos didnt make that too confusing)
<pjb> dmiles: yes, but :type vector uses plain lisp vectors. The only thing is that you can have :name option (to add the structure type name in the first slot), and :initial-offset, and the fact that you can use :type `(vector ,size) to allocate more than needed slots.
<pjb> dmiles: mind also the :include option.
<dmiles> (oh .. i secretly roll include and type into the same dohickey ;P .. wasnt sure if that was going to play agaisnt me)
CrazyEddy has quit [Ping timeout: 260 seconds]
<pjb> Well, one problem is that you need to define accessors with the conc-name of the current structure for all the slots that are included with :include.
<dmiles> :include is rather the scenario perhaps i am thinking against
<pjb> So you need to keep track of them. For CLOS you can use the MOP and the superclass, but for :type list and vector, you have to handle it yourself in the defstruct macro.
sjl has quit [Ping timeout: 246 seconds]
<dmiles> i think i see now.. it might still turn out ok.. if they are supplying the :type list :initial-offset 3 .. what is it they are expecting?
<_death> aeth: my patch also mentions the slot name and the instance
<dmiles> (i am asking if they wanted their list to start at internal offset 3)
<pjb> dmiles: (defstruct (point (:type list) (:initial-offset 3) :named) x y) (make-point :x 1 :y 2) #| --> (nil nil nil point 1 2) |#
shrdlu68 has quit [Quit: Lost terminal]
<pjb> it allocates 3 slots in the list, before storing the structure data.
rumbler31 has quit [Ping timeout: 260 seconds]
<aeth> _death: But is there a way to force the type checking on those who don't want safety (well, at least when safety > 0)?
<ebrasca> Good nigth.
<aeth> A type is, imo, essentially useless when it can be wrong.
<dmiles> pjb: ah, thank you.. i know i should had gotten that from docs but it is more fun sometimes hearing it for sure
pilfink has quit [Quit: ERC (IRC client for Emacs 27.0.50)]
<_death> aeth: sbcl has some machinery for fine-grained optimization settings, methinks.. but I don't know/remember much
<pjb> (defstruct (point (:type (vector 10)) (:initial-offset 3) :named) x y) should be accepted, but apparently it's rejected by clisp, sbcl and ccl…
<pjb> Notice that you can define implementation specific types too, if you want.
<pjb> (defstruct (point (:type prolog-predicate)) x y)
<pjb> perhaps?
<dmiles> pjb: right actualyl good example
Cymew has joined #lisp
<dmiles> pysically in my system i want to promot doing.. (defstruct (point (:type prolog::point/2)) x y)
<dmiles> promote*
<aeth> _death: thanks for making me aware of alternatives, but I think for now I'll stick to structs when I want to force type checking.
<dmiles> prolog::point/2 is autodefined as structure-like thing that has two slots
<dmiles> (to deplict point(23,45) )
<dmiles> (when prolog code introduces lisp to its innerds ... i been thinking of having iot be seen as a structure that way)
Cymew has quit [Ping timeout: 264 seconds]
atgreen has joined #lisp
<dmiles> (also of course letting lisp see the innerds lisp is actualyl ussing as accesable autodefined structures :P)
terpri has quit [Ping timeout: 240 seconds]
<dmiles> i been shifting the :initial-offset when someone uses :initial-offset on the :type super (super is shifted)
<dmiles> is sorta assumed.. (maybe wrongly) that :type was sort of :include
<dmiles> (i know .. :include isnt norally part of structure-classes :P)
z3t0 has joined #lisp
<dmiles> oops sorry .. i got confused there
<aeth> The problem I have with type checking at the moment is that I currently architecture my program as users providing data. So type-checking (and possibly other kinds of checks) might happen two or more times because ideally any mistakes should be caught early, but the program also cannot trust the input (someone could have created them another way other than the official way, to avoid the overhead of the checks).
<dmiles> right so yes :include is shifting offsets .. but i am glad pjb mentioned that it doesnt shift the :type
iqubic has quit [Remote host closed the connection]
<aeth> But I think once the data is checked in my program, it could be trusted (even to the point of (safety 0), but I wouldn't do that) unless it's a function that can be redefined (for first class functions I funcall 'foo instead of #'foo based on recommendations here)
varjag has quit [Ping timeout: 268 seconds]
<aeth> pjb: what does :initial-offset do?
z3t0 has quit [Remote host closed the connection]
<aeth> in combination with the other things
fisxoj has quit [Quit: fisxoj]
<aeth> It looks like it would either be (blank blank blank name x y blank blank blank blank) or (name blank blank blank x y ...) or something similar
shifty has joined #lisp
* dmiles relizes njow that this .. www.lispworks.com/documentation/lw70/CLHS/Body/m_defstr.htm has examples of :initial-offset but was hoping to see the :name shoved in there
earl-ducaine has quit [Remote host closed the connection]
pillton has quit [Ping timeout: 248 seconds]
earl-ducaine has joined #lisp
Bike has joined #lisp
<dmiles> then again structs are secretly never really anything more than some synthethic getter/setters over typical list or vetors
<dmiles> (when they are lists or vectors that is)
kokonaisluku has quit [Remote host closed the connection]
<dmiles> (make-binop :operator '+ :operand-1 'x :operand-2 5) => (NIL NIL + X 5) so aeth (type-of (make-binop :operator '+ :operand-1 'x :operand-2 5)) is CONS?
smasta has quit [Ping timeout: 256 seconds]
<pjb> aeth: in lisp, blank is NIL!
<dmiles> (so in fact #'operator-1 is #'cdar ?)
<dmiles> (oops sorry i forgot the offsets)
<pjb> aeth: so, yes, (defstruct (point (:type (vector 10)) (:initial-offset 3) :named) x y) (make-pointm :x 1 :y 2) should return #(nil nil nil point 1 2 nil nil nil nil).
shifty has quit [Ping timeout: 248 seconds]
<aeth> pjb: Afaik, blank is normally NIL, but blank can be 0 in specialized numeric arrays, but... this is I think undefined behavior, so :initial-element 0 or :initial-element 0f0 or :initial-element 0d0 etc. is probably necessary in those cases for true portability
quazimodo has quit [Ping timeout: 256 seconds]
<aeth> (And similarly, NUL with character arrays, i.e. strings)
<aeth> but, yeah, T array so I should have just said nil
holycow has joined #lisp
<pjb> aeth: obviously, structures cannot use specialized arrays. But an implementation could allow it, if you don't pass :named and if all the slots have the same type.
<aeth> yeah, you can't use named with that
<pjb> In that case, indeed, a different value would have to be used in the unintialized slots.
nopoliti1 has joined #lisp
<aeth> I do like that Lisps do set things to NIL, (coerce 0 'whatever-number-type), or (code-char 0) though. Or at least, tend to.
<aeth> Safety!
nopolitica has quit [Ping timeout: 260 seconds]
wigust- has joined #lisp
<dmiles> ah ok so now i understand :named !
makomo has quit [Ping timeout: 264 seconds]
wigust has quit [Ping timeout: 248 seconds]
* dmiles would have made :named the default and expected :unnamed