freenode/#lisp - IRC Chatlog
Search
16:56:55
Bike
and maybe use a moving displaced array to avoid making new substrings, but i don't know if that actually works off the top of my head
17:13:02
clintm
Do any of you know if there are any weird corner cases with using hunchentoot, zs3, and file uploads? With a 2g heap, I'm exhausting the heap trying to upload a 107k image.
17:16:42
Bike
oh, right, there are rules about not messing with hash table keys. there goes my cleverness
18:04:33
puchacz
hi, does anybody know please why uffi has pretty complex implementation of convert-from-foreign-string for sbcl, while the manual says that strings are converted automatically between Lisp and alien?
18:31:37
drmeister
If I installed hunchentoot using (ql:quickload "hunchentoot") and then realized that there are implementation dependent features that I need to specialize for clasp. If I clone hunchentoot from github into ~/quicklisp/local-projects and delete it from ~/quicklisp/dists/quicklisp/software - will everything just work?
19:19:34
flip214
drmeister: in the worst case you might need to restart your lisp, to make quicklisp find the other location.
19:46:08
aeth
Execution of a form compiled with errors.\nForm:\n ('X QUOTE Y)\nCompile-time error:\n illegal function call
19:46:31
cromachina
regardless of how it evaluates to.. he probably wants to know what the dot generally refers to
19:47:08
pjb
cromachina: nope. A dotted list is a list whose last cons cells has a non-nil atom in its cdr.
19:48:22
aeth
pjb: you're absolutely correct, I should have errored on the first error, i.e. "The variable WHAT is unbound."
19:49:14
pjb
pebblexe_: if you consider ('x . 'y) as a list, then it is a proper list. If you consider it as a data item, then it is a cons cell. The dot notation let you enter literal cons cells. (a . d) is the cons cell with a in its car and d in its cdr.
19:50:38
pjb
pebblexe_: 'x == (quote x) so ('x . 'y) == ((quote x) . (quote y)) == ((quote x) quote y) which is a list of 3 items.
20:09:54
drmeister
flip214, Bike: Thanks - I got it running somewhat. Now I'm dealing with my first bug involving threading.
20:11:19
drmeister
An Illegal function designator 0 means I have a function designator that is uninitialized (initialized to NULL, which is fixnum 0 in Clasp)
20:18:03
foojin
Sorry for an elisp-related question but #emacs is closed for unregistered users. Anyway, how are quoted values actually allocated: once (as if they're constants) or every time I evaluate them?
20:18:07
foojin
More specifically, how is `(nil (nil)) different from `(nil (,nil)) if my intention is to store it in a variable and mutate it afterwards?
20:33:44
foojin
Bike: Assuming elisp has the same rule, would (list nil '(nil)) be the least verbose way of expressing the same value? BTW the '(nil) would only be read and eventually cut out entirely.
20:34:14
Bike
if you mean that you're just going to change what the second element is without mutating it, yeah
20:39:31
foojin
Bike: Yes. that's what I have in mind. Thanks for pointing out the undefined behavior thing, I'll try to find a specification for elisp to see if it has the same quirk.
20:44:04
jasom
foojin: copy-list of a backquote is the lazy way to allow modification of the list structure.
20:46:08
boboc
Hi all, i'm an iOS developer and after reading some web articles i decides to learn lisp. I've read that even if i will not program in Lisp it will be very valuable to learn. Any recommendations?
20:46:34
minion
boboc: please look at 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).
20:47:28
jasom
boboc: also, for a working portable IDE, check out https://shinmera.github.io/portacle/
20:48:01
jasom
boboc: IIRC Practical Common Lisp links to a no longer maintained lisp development environment
20:50:23
jasom
minion: add "portacle" as: Portacle is a complete IDE for Common Lisp that you can take with you on a USB stick https://shinmera.github.io/portacle/
20:50:37
minion
jasom: portacle: Portacle is a complete IDE for Common Lisp that you can take with you on a USB stick https://shinmera.github.io/portacle/
20:52:00
pjb
boboc: there are ways to use lisp in iOS programs. Eg. you can use mocl ( http://www.wukix.com ), or theorically, ccl or ecl (no batteries included). But it will be more work than just using Xcode.
20:52:51
jasom
boboc: I would not recommend your first lisp program to be on iOS for the reasons pjb mentions; it's quite straightforward to develop for desktops though.
20:54:28
foojin
jasom: Thanks, that would come in handy with larger lists, a lot better than putting "list" everywhere.
20:59:46
foojin
jasom: Browsing through the manual I nearly thought that it was renamed to copy-tree in elisp.
21:10:37
jasom
speaking of IDEs, I've just got to code the UI for the REPL in my geany lisp-mode and it will be ready for unleashing on the world.
22:05:26
jasom
phoe: not too much new screenshot wise, I mainly have fixed bugs. I also now made it so the "Make" command in geany will do a load-system with the system name of the current project.
22:14:36
jasom
http://i.imgur.com/yI8OjdV.png http://i.imgur.com/VKOHGJm.png http://i.imgur.com/o5LMFUt.png
22:15:04
jasom
they are completion, jump-to-definition and highlighting compiler warnings respectively
22:15:46
fourier
jasom: wow looks awesome! publish on r/lisp so people could upvote you to the stars ?
22:16:41
jasom
just a lot of writing GTK code in C that I wasn't looking forward to; all of the plumbing is there in the slime server though.
22:19:51
fourier
jasom: it will worth it. having more ide choices for CL is just awesome. most people leave afte the phrase : "well first you need to install emacs"
22:30:13
phoe
finally we will have an argument against the de facto truth that writing Lisp requires Emacs
22:38:37
aeth
Also, if you're really lost in a sea of parentheses, do this: (declaim (inline %foo) (defun %foo (bar baz) ...) and break up that function without losing any performance... imo.
22:40:47
aeth
Tiny functions can get rid of most comments imo, except e.g. comments when you explain why you did something in a non-obvious way rather than the obvious way that causes some issue.
22:52:48
aeth
The most consecutive )s I have in one program: 12 )s (1 times), 8 )s (3 times), 7 )s (6 times), 6 )s (11 times), 5 )s (32 times)
22:54:02
aeth
interestingly that's approximately powers of 2, i.e. 2 4 8 16 32... so I can predict I have 64 4 )s, 128 3 )s, 256 2 )s, and 512 1 )s
0:14:00
fourier
aeth: paredit overvalued - I never used them since if I press Backspace I expect to actually delete the charater before the point. Sure a lot of people would find it useful, but not those who while editing the text expects, well, to edit the text
0:14:58
fourier
aeth: magit could be good, but it can't replace normal command line with completion - like zsh + oh-my-zsh. Also it is slow as hell.
0:15:39
fourier
so the last is slime, but again it depends mostly on clients like what jasom implements
0:16:33
fourier
pillton: no I edit the text which happens to contain s-exprs. and then I hit the key to erase char i expect char to be erased
0:18:46
fourier
i mean the reason most people use emacs is what it is not doing anything fancy with the text, unlike IDEs. It just works and allows you to edit the text in different manners. But paredit just prevents you from modifying freaking text in a usual way! sure it is helpful to a lot of people, but me personally never get ok with it.
0:22:04
Xach
I liked that I was able to stop worrying that I had misplaced structure. That was a frequent problem when I balanced things manually.
0:24:06
pjb
fourier: no, the point of emacs, is that you can program it to automatize your editing tasks. This means that now instead of editing characters, you're editing sexps.
0:24:34
pjb
The next step would be to be editing definitions or specifications, and to let emacs write the code for you!
0:24:35
aeth
fourier: also, oh-my-zsh is unusably slow, completely ruining zsh, last I checked (it has been a while)
0:25:04
aeth
And besides, I personally would much rather be able to review my diffs in the same editor before commiting, using commit messages written in the same editor.
0:26:22
aeth
fourier: I think the reason most people use emacs is that it's one of the few editors where you don't ever need to touch the mouse.
0:26:33
fourier
pjb: i'm fairly ok with emacs :) I just don't get extensions which prevents text editing
0:27:08
aeth
Emacs is buffer-oriented rather than having clickable things (once you turn off the unnecessary tool bar and menu bar and scroll bar bloat), so it's 100% keyboard-driven.
0:28:26
fourier
aeth: I know I know :) I said I more/less comfortable with emacs itself. just not paredit
0:29:31
aeth
And as for text editing vs s-expression editing, I agree with pjb. e.g. when I C-k at the start of an s-expression, I expect to take a well-formed s-expression in that kill. I don't want to have to select it, and I normally can't just count out how many lines to kill even if it's short because of the ")))))..." style.
0:30:43
aeth
Without paredit, and with the standard CL style, the core emacs feature of C-k is broken because even C-u 3 C-k for a three-line subexpression is probably going to imbalance the parens and break things
0:32:30
fourier
like imaging pressing backspace in C mode will kill up to the prev { or ( whateevr is first
0:32:52
aeth
Different languages necessitate the rules being broken in different ways. E.g. languages with whitespace being significant like Python need to be special cases for auto-indentation, and various ways to handle indentation
0:33:53
aeth
CL just happens to need a non-line-oriented way to kill text because of its )))) style. } languages have }s on their own line and "end" languages have "end"s on their own line
0:34:41
aeth
And it only behaves specially when on top of the ( anyway. Maybe other languages *should* kill the block when you're on the {
0:35:26
aeth
(There are *some* annoying things in Paredit, one of which I had to disable because it was that annoying... but for the most part, I can't live without being able to kill a whole expression at once from being on "(")
0:36:54
aeth
But, again, s-expressions are not particularly line oriented, especially when )s are bunched together, so line-oriented assumptions need to be broken by the editor imo.
0:46:49
aeth
right but on other numbers it's 1 because 1/x * x = 1... x^0 = 1, x^1 = 1 * x, x^2 = 1 * x * x, ...
0:47:38
aeth
(expt 0 some-negative-number) errors because that'd be saying 1/(0^some-negative-number)
0:52:57
aeth
if anyone's too lazy to clhs btw: http://www.lispworks.com/documentation/HyperSpec/Body/f_exp_e.htm
0:56:53
Bike
because, again, it's easy to show that the limit of x^0 is one, and the limit of 0^x is zero
0:58:47
aeth
Bike: But Lisp arithmetic normally gets so much so right imo, with the numerical tower, rationals, complex, etc.
1:00:12
Bike
and i don't know why? you can work out that 0^0 should be zero by a perfectly legitimate series of manipulations, and another perfectly legitimate series of manipulations will get you one, and neither of them is inherently the right way to do it
1:04:13
Bike
the clear answer is there's more than one way to assign a value to it. check that graph under "continuous exponents". different limits get you different answers. on a basic level this is because 0,0 is a branch point of expt, and it's not going to go away, because expt is inherently a multifunction
1:05:23
Bike
lisp math functions usually have well defined behavior there, and so does expt. this answer has the advantage of matching empty product, which helps the easy definition of expt on nonnegative integer exponents
1:10:16
aeth
Personally, I'd go with this pragmatic explanation: Math software is split, programming langauges almost always go with 0^0 = 1, and CL is the latter, not the former, and it'd break programming expectations not to conform.
1:10:57
aeth
Although, on the other hand, CL does happen to allow e.g. (expt -3.5 5.5) because it supports complex.
1:12:56
Bike
CL is probably earlier than a lot of this. it might copy APL, which also seems to define 0^0 as one
1:15:26
Bike
oh nope they are apl symbols MULTIPLICATION SIGN, SOLIDUS, APL FUNCTIONAL SYMBOL OMEGA, etc RHO, etc ALPHA
1:15:29
aeth
I do need to restart this IRC client at some point when there's not that much activity so I can get unicode back...
1:18:51
TruePika
JSON only supports up to UTF-16 encoding, such that some characters are stored as a surrogate pair
1:19:36
TruePika
and then cl-json isn't smart enough to merge such a pair into a single character, resulting in SBCL getting that pair of characters invalid in UTF-8
1:21:08
TruePika
anyway, now I'm trying to figure out the easiest way to convert this "UTF-16" string to the native CHARACTER encoding
1:21:10
aeth
It's amazing how many problems solved more than 20 years ago that the web is unsolving, though. Although I guess the alternative is Win32's wrong-forever backwards compatibility rather than the right thing.
1:23:54
TruePika
or as UTF-8 on disk; the easiest way to save it to disk is UTF-16 (saving the CHAR-CODE values as (unsigned-byte 16) so the surrogate pairs get interpreted)
1:26:33
TruePika
and that extended ASCII (8 bits) is an official thing (and not actually CP437/CP1252)
1:37:27
aeth
Want to define a new official 8-bit extended ASCII? Maybe we could even try to get it into Mezzano or some other LispOS.
1:41:49
White_Flame
I looped through all the char codes a while back: https://imgur.com/gallery/AvbN7
1:42:27
White_Flame
although the on-disk file format can redefine codes on the fly, for tighter encoding
1:43:37
White_Flame
oh, they also encoded font style bits in the upper portion of the character code
2:00:17
White_Flame
the file format had an escape character (which coudl also be changed mid-stream), which would be followed by a sexpr defining the changes, iirc
4:26:51
Bike
"n Unicode, Graphic characters are those with General Category Letter, Mark, Number, Punctuation, Symbol or Zs=space."