freenode/#lisp - IRC Chatlog
Search
6:18:39
emaczen`
I'm printing out the dynamic-space-size from the external program and it is the default 1 GB...
6:25:37
jackdaniel
emaczen`: compare `sbcl --dynamic-space-size 4096 --eval "(print (sb-ext:dynamic-space-size))"` in the repl with `sbcl foo --dynamic-space-size 4096 --eval "(print (sb-ext:dynamic-space-size))"` (likewise)
6:26:25
jackdaniel
`sbcl --dynamic-space-size 4096 --eval "(print (sb-ext:dynamic-space-size))" program-name ` should work though
6:27:26
jackdaniel
http://www.lispworks.com/documentation/HyperSpec/Body/f_set.htm, http://www.lispworks.com/documentation/HyperSpec/Body/a_setf.htm
6:28:36
emaczen`
jackdaniel: I see... that is kinda lame, I would have never figured that out myself
6:31:53
jackdaniel
iqubic: if it is qouted in the linked example, then why not? I highly recommend reading both linked pages and if you still have questions *after that* asking them here :)
6:39:41
beach
iqubic: Do you know what the quote character means? If not, you definitely need to take a break and go read a book.
6:41:26
iqubic
('symbol) is the syntax. ' is a reader macro that expands to the function (quote symbol) which returns the symbol exactly as it is, with out evaluation
6:42:54
iqubic
It returns symbol, exactly as it is. No evaluation is done at all. ('symbol) => symbol.
6:44:29
emaczen`
I'm running (sb-ext:run-program ...) but when the external sbcl program's heap becomes exhausted I am dropped into ldb. I just want to exit from this and for my main program to continue.
6:44:45
beach
iqubic: If the reader return (quote <something>) when it sees '<something>, then what does it return when it sees ('<something>)?
6:45:47
iqubic
Or wait, I was reading the input as if it were the output. When the reader sees ('symbol) it returns ((quote symbol))
6:47:43
jackdaniel
maybe wrapping your program in handler-case and catchin heap exhausted (and exitting application) would do what you want
6:49:33
minion
iqubic: direct your attention towards pcl: pcl-book: "Practical Common Lisp", an introduction to Common Lisp by Peter Seibel, available at http://www.gigamonkeys.com/book/ and in dead-tree form from Apress (as of 11 April 2005).
6:49:34
beach
That I have figured out. What I haven't figured out is why you prefer asking trivial questions in #lisp (which is not a Common Lisp support channel) rather than reading a book.
6:51:50
beach
emaczen`: Such a condition would be hard to implement. I mean, if the heap is exhausted, how does it allocate space for the condition instance? And what would you do when it is signaled? Examine the stack? That requires form evaluation, taking up even more heap space.
6:55:56
emaczen`
jackdaniel: Yep! thanks, now I can go to bed and my program should run all night, and I don't have to be here to restart it when it drops into ldb!
7:01:26
pjb
iqubic: if the symbol designates a lexical variable, then its value will be different from (symbol-value symbol).
7:01:51
pjb
iqubic: on the other hand, if it designates a dynamic variable, then its value will be that of (symbol-value symbol).
7:02:31
pjb
(let ((foo 42)) (declare (special foo)) (list foo (and (boundp 'foo) (symbol-value 'foo)))) #| --> (42 42) |#
7:05:33
z3t0
I have some code and am wondering what is the best way to return the object at data from this function
7:05:56
z3t0
I understand that let returns the value of its final form, except the final form in this case must be closing the file
8:57:42
jackdaniel
johnnymacs: if there is gcc which can produce webassembly binaries, you could compile ecl or clisp
8:58:48
Shinmera
Anyway, good luck shipping like 10-20mb of wasm CL runtime or whatnot to run your few kilobytes of actual CL code.
8:58:55
jackdaniel
for instance there were builds of ECL to NaCL and pNaCL (obsolete chrome runtimes)
8:59:41
Shinmera
didi: (or symbol function), if you're talking about any function, and not specifically eq.
8:59:45
jackdaniel
Shinmera: given wasm binaries are not much bigger than linux ones, ecl should fit in around 1mb, what is comparable to some js scripts I saw in production
8:59:50
lerax
If someone have interest in Propositional Logic, I've been written this library with some efforts: https://github.com/ryukinix/lisp-inference
9:00:26
didi
Shinmera: Thanks, but I'm specifically talking about eq. Actually, eq, eql, equal, and equalp.
9:02:46
jackdaniel
then if you have time and resolve try compiling ecl and clisp and see how far you can get ;)
9:05:19
Shinmera
Anyway, checking a value for a certain... well, value, with a type, seems just plain wrong to me
9:05:52
didi
Shinmera: Use case: I have a data structure that uses only eq, eql, equal, or equalp as a test.
9:10:11
heisig
lerax: This is a nice little project. Since you decided to represent statements as lists, have you considered using DEFSTRUCT with (:type list)? Then you get accessors and predicates for free.
9:12:15
lerax
This a old project that I'm re-touching this again now. Probably I'll define later better data-structures for this. On those days, I just was trying getting fun with propositional logic and Lisp. Later that I read some books... well, things changed. Yes, I need review that.
9:13:11
beach
johnnymacs: Even if you manage to translate Common Lisp to webassembly, you still need a complete Common Lisp system in the target (I assume a browswer), including all the "library" functions, the memory manager, etc.
9:13:49
lerax
But I don't have sure if defstruct for this specific problem is a good idea because in general manipulating lists sometimes is basic always I need to parsing logic statements... but well, maybe with defstruct I can reduce the verbosity.
9:15:29
heisig
lerax: Unless you are under severe performance constraints and know what you are doing, represent your data with CLOS.
12:19:21
beach
"fruit flies like a banana", but there are actually many more ways of parsing that sentence. It could mean "please measure the time that flies take, just the way that you would measure the time an arrow takes".
12:19:48
beach
Or "please measure the time that flies take, just the way an arrow would measure the time that flies take".
13:06:43
flip214
perhaps that call wasn't inlined because the function definition wasn't available yet.
13:13:01
|3b|
well, can't be much more specific than that, somewhere in the inlined code it didn't know the type of the first argument of something
13:13:39
|3b|
(there could be multiple calls to same inlined function with different notes, do it can't really point you at the original source either)
13:20:13
shrdlu68
|3b|: I would expect it to issue the compiler note when I compile the inlined function itself in that case.
13:21:13
Shinmera
When it inlines it, well, inlines the code, which will lead to different inferences.
13:22:25
Shinmera
For instance (defun foo (a) (typecase a (integer 1) (character 2))) (defun bar () (foo 0)) is going to eliminate the useless branch if foo is inlined.
13:23:41
Shinmera
The optimisation constraints of the inliner are also going to affect the inlinee code.
13:26:32
Shinmera
In the most basic sense think of inlining as copy-pasting the code before compiling for real.
13:52:18
shrdlu68
How do I fix "Unable to optimize because Upgraded element type of array is not known at compile time"
13:53:51
Bike
i don't know what your code looks like, but sbcl might not be smart enough to guess the element type at the access point based on that
13:56:06
Bike
a form being underlined just means that there's a note or warning or whatever about it, btw
13:56:32
Shinmera
you can also hover over the underlining with your mouse and it should display the note
16:29:12
Shinmera
flip214: You can follow development here https://github.com/european-lisp-symposium/els-web
16:32:36
Shinmera
The latter being preferable because it means all your data will be automatically recorded with the transaction.
16:33:32
Shinmera
The bank transfer stuff is annoying because it means someone has to manually confirm that you are you and that you paid your registration.
16:34:42
Shinmera
I don't know what Didier does with his bank stuff and don't think it's my business either.
16:35:04
Shinmera
What I can do is offer CC payment which should be more convenient for both payer and payee.
16:35:44
flip214
is there some easy way to tag strings as different classes? like firstname, surname, street, etc.
16:37:15
Shinmera
Whether a string is a name, street, or whatever depends on who looks at it, so that information should be encoded in the container.
16:39:02
flip214
well, currently I'm storing a list of strings (just to print them out in the same order again)
16:47:09
Shinmera
Or don't store a list of strings, but a list of compund objects that carry that associated information
16:50:18
_death
since strings aren't usually used for their identity the hash-table solution could be fragile
16:50:50
flip214
Shinmera: yeah, that's what I'm doing now... is there a way to embed the string structure in my class slot and not have another indirection, to conserve memory?
16:51:35
Shinmera
A string indirection is free as long as the type is known as the header will just be a constant offset to the contents.
16:56:57
flip214
one of the input files is 19M lines, each being parsed into multiple items... so 2 tagged-strings in a line would be 2*16 byte (?) for the indirection
16:58:24
Shinmera
Besides, if you are sure you need to keep that much data around at all times (rather than, say, stream it), then classes will be too heavy anyway and you probably want structs instead.
16:59:42
Shinmera
My advice would be to investigate other means of processing your data (stream oriented) so that you don't need that much memory to begin with.
17:32:35
asarch
One stupid question: From this chapter: http://www.gigamonkeys.com/book/macros-standard-control-constructs.html
17:33:13
asarch
In the DO section: "As with the variable definitions in a LET, if the init-form is left out, the variable is bound to NIL. Also as with LET, you can use a plain variable name as shorthand for a list containing just the name."
17:34:22
beach
asarch: It means you can write either (let ((x nil)) (let ((x)) ...) or (let (x) ...)
17:34:30
dlowe
it means like you can do (let ((foo nil)) ...) and (let ((foo)) ...) you can also do (let (foo) ...)
17:41:18
beach
asarch: Let me take advantage of your question to point out the (moral, not semantic) difference between (let ((x nil)) (let ((x '()) and (let (x).
17:41:27
beach
In the first case, you initialize x either to a Boolean false value or to some default value. It is fine to use x before assigning to it and to (conditionally) assign to it before using it, but you would not unconditionally assign to it before using it.
17:41:32
beach
In the second case, you initialize x to the empty list. Again, it is fine to use x before assigning to it and to (conditionally) assign to it before using it, but you would not unconditionally assign to it before using it.
17:44:23
beach
asarch: Imagine (let (x y) ... Is that the same as (let ((x y)) or the same as (let ((x nil) (y nil))?
17:46:46
beach
asarch: Because of what I wrote. It could either mean both X and Y to NIL, or binding X to Y.
17:48:52
shrdlu68
The second form would not be possible in a let form that took the form (let (x 1) (y 2)
17:49:05
_death
beach: it wasn't meant as an advice, just an attitude perhaps meant for someone more experienced ;)
17:49:52
shrdlu68
You'd have to always use (let (x nil) explicitly. But as _death points out, it's entirely possible to create such a let macro.
17:53:58
stacksmith
Alexandria's when-let compromises: if you only have a single binding, you can (when-let (a whatever) ...), and if you have multiple, it looks like (let).
17:56:57
stacksmith
The 'founding fathers' could have gone with a lambda-list-like syntax: a name or a list containing a name and an initializer... (let (a b (c 9)) ...)
18:01:51
stacksmith
_death: I am not sure how useful they are - I always wind up with the second form needing unless, for some reason :)