freenode/#lisp - IRC Chatlog
Search
15:27:45
fe[nl]ix
I'm thinking of distributing an sbcl with libfixposix compiled in, to ease distribution
15:27:48
ralt
PuercoPop I wanted to change its constituent trait so that it would be a normal symbol char
15:29:26
ralt
another project of mine would be interested though, you could make an sbcl binary for centos?
15:43:39
PuercoPop
ralt: iiuc, lisp code is inserted after a #, wouldn't a reader macro for # be more appropriate? With lisp-reader you can subclass syntax-table and add another :after method that removes the +ct-package-marker+ from the ":" standard-characters (the index character description in the 58 in this case)
17:20:29
p_l
DeadTrickster: yes and no. the hard way is finding a job advertised for lisp hackers and get it, although clojure helped there if yiu want to work in clojure
17:21:33
p_l
DeadTrickster: the other way around is to factor out language out of consideration altogether by getting contracts to build stuff for companies as complete systems
17:24:49
p_l
Fare: might want to look at Gentoo patches - hardemned is rather strict on pie/pic, but they build sbcl
17:29:42
DeadTrickster
p_l, that is exactly what I'm doing now. basically when people don't care I use CL
18:32:25
minion
_JusSx_: please look at hyperspec: The Common Lisp HyperSpec can be found at http://www.lispworks.com/reference/HyperSpec/ - or go to the contents at http://www.lispworks.com/reference/HyperSpec/Front/Contents.htm
18:43:26
minion
are you a bot": An error was encountered in lookup: Parse error:URI "http://www.cliki.net/are%20you%20a%20bot\"?source" contains illegal character #\" at position 40..
19:44:56
fewdea
i'll have a look at perec then. i've been coding for nearly two months using postmodern, but it's becoming more and more obvious that not having automatic relational objects are a problem. makes for clunky model-layer code
19:54:09
vmonteco
I'm reading the PCL, the functions chapter (http://www.gigamonkeys.com/book/functions.html) And I don't understand everything in the part about optionnal parameters, I unserstand the basics, but I don't understand what is the last example about. http://dpaste.com/0TWWYHW . what's the point here?
19:55:11
Bike
it's not a function you'd actually use. it's just demonstrating the syntax of &key arguments, specifically that you can have a different keyword and variable name, defaults, and supplied-p parameters.
19:56:34
phoe_krk
a) place a symbol in its place and have it set to NIL when it's not supplied by the programmer,
19:56:50
vmonteco
Bike: Oh! I think I get it, this way I could have a keyword I use when calling the function, the value I enter after the keyword is bound to a variable and the name of the variable isn't the keyword?
19:56:53
phoe_krk
b) place a list of form (name default-value) and have it set to default-value when it's not supplied by the programmer,
19:57:28
Bike
vmonteco: yeah. for this one, if you call it like (foo :apple 9) it returns (9 0 0 nil).
19:57:40
phoe_krk
c) place a list of form (name default-value is-it-supplied) and have it set to default-value when it's not supplied by the programmer and have is-it-supplied set to NIL. If it's supplied by the programmer, then the default value is ignored and is-it-supplied is set to T.
19:58:15
phoe_krk
This way you can check, inside the function, whether someone supplied an argument to it, or whether a function operates on a parameter's default value.
19:58:37
vmonteco
So : keyword -> function call side, what's after this keyword -> name of the variable inside the function?
20:00:45
vmonteco
(defun foo (&key ((:keyword bar))) bar), :keyword is used when calling foo, but bar remains inside the function code?
20:02:50
phoe_krk
If you call (foo) now, it returns what is given to it by :keyword. You don't provide a :keyword argument if you call (foo), so it returns NIL.
20:03:29
phoe_krk
So baz doesn't leave the function indeed, it is its local variable. Its parameter, to be specific.
20:03:34
vmonteco
phoe_krk: In my example, I will call (foo :keyword value) and value will be bound to - local - variable bar? Is that correct?
20:04:07
phoe_krk
And, once the function returns, the baz value gets returned and afterwards, baz and its value get forgotten.
20:04:41
phoe_krk
Unless you force it to get remembered by some means, but that's a whole different story.
20:06:07
vmonteco
phoe_krk: To keep this local variable in the table of symbols? (<-- not sure about how to say this, sorry)
20:07:37
Bike
you don't need to think about symbol tables. in the body of the funcion there's a local binding to "a", and the value for that binding is provided by the ":apple" argument in a call.
20:09:12
vmonteco
Bike: That may be too soon for me. I think I'll just keep reading the PCL :) Anyway thank you all for the help!
20:11:52
vmonteco
phoe_krk: Yes, I have more experience in C but I also know some C++ since this year.
20:12:21
phoe_krk
If, inside the ..., you call, let's say, int a = 2048;, then you have a local variable called a.
20:12:47
phoe_krk
Alternatively, if you go like int something_else (int a) {...}, you also have a local variable called a - but that variable is essentially a parameter to your function.
20:13:43
phoe_krk
Except that C doesn't (easily) let you add optional parameters to your functions. In Lisp, that's much easier, with &optional &key and so on.
20:15:13
phoe_krk
In Lisp, you can define a function so it can be called with any number of arguments - some of which you want to predict, some of which you don't want or need to.
20:16:51
vmonteco
phoe_krk: Yes, but now I think I get it: I already knew how to use optionnal parameters the basic way, I was just wondering what was happening with the syntax in the last example (http://dpaste.com/0TWWYHW) but you guys perfectly answered my question. ^^
20:17:37
phoe_krk
(defun print-my-thing (thing &key (color nil color-set-p)) (if color-set-p (format t "A ~A ~A." color thing) (format t "A ~A." thing)))
20:18:25
phoe_krk
I explicitly call an if on the color-set-p. Look at what happens and why it happens.
21:30:25
francogrex
there is a sigificant decrease in power of lisp on github the following few months. Example since 2016-02-13 there are only 14 new lisp projects versus over 4000 for java and over 2000 for python. It was not like that last year!
22:01:42
knobo
Would be nice to have a optima pattern-specifier that says it should take the value of the variable, not the as the symbol to bind the target value to.
22:04:11
knobo
so tat (let ((val :val)) (match '(:key :val) (property :key (ref val))) is the same as (match '(:key :val) (property :key :val))
22:11:06
knobo
(let ((val :val)) (match '(:key :val) (property :key (eql val))) is what I'm looking for.
1:12:16
axion
i'm trying to find a solution to set speed for a whole library to be released, without it bleeding into other code.
1:13:41
pillton
There is a trick I have seen where you put #.(library-declaimations) at the top of each file.
1:14:22
White_Flame
it works fine for me without the reader macro, as a regular macro such as (optimize-file) at the top
1:17:14
White_Flame
I also have (slow-body &body ..) defined to muffle optimization notes where I'm fine with them. SBCL just _loves_ spewing them out when you crank up speed :)
1:19:11
Zhivago
white flame's point is that a regular macro works at the top. Your point seems to be that #.(...) is required in a let form, etc.
1:23:41
White_Flame
I use that when I'm fine with a body section not attaining full optimization. I mark it as acknowledged by muffling the tightest relevant scope
1:27:34
White_Flame
(slow-body (incf *some-counter*)), where the counter may pass into bignums on 32-bit, and I don't care about that particular overhead
1:29:04
White_Flame
put a declaim at the top of files, either literally or via macro with a centralized definition. Rely on ad-hoc behavior of declaim not leaking outisde the file compiler. Good enough
1:30:09
White_Flame
The goal is to have your lib code optimized without globally affecting optimization declarations, right?
1:30:54
axion
yes. the other day in here i was told never to put declaim at the top for libraries, as itd bleed into other code once released
1:31:58
White_Flame
but yeah, if you're paranoid about it, you can wrap the whole file in (locally (declare (optimize ..)) ...)
1:32:13
axion
but it affects performance too much. i dont want to potentially mess with others' compiled code
1:34:42
White_Flame
however, I've never seen such a locally declare wrapper in the wild, while I have seen per-file declaims in quicklisp
1:38:24
White_Flame
axion: also, the lifecycle of running the code in the asd file is independent of loading all the files from the system