freenode/#lisp - IRC Chatlog
Search
2:15:25
White_Flame
oh, and "abc" is probably wrong, because :abc and #:abc imply the string name "ABC"
2:17:35
aeth
hectorhonn: all of the non-string ways, including potentially some others you didn't list, will (probably, it depends on your settings but by default) translate to "ABC"
2:19:25
aeth
The only time you ever want to modify stuff like that is if you're implementing a case-sensitive language within CL, which, of course, can have issues at the interface between the two.
2:20:11
aeth
For all practical purposes, CL is a case-insensitive language that upcases unless you escape with || like '|foo| because you'd break too much code if you switched modes.
2:22:09
hectorhonn
aeth: not sure if you are replying to me, i meant this as in "abc" vs :abc vs #:abc
2:22:38
aeth
hectorhonn: "abc" will produce the package "abc" aka :|abc| or #:|abc| whereas :abc and #:abc will produce the package "ABC"
2:22:52
White_Flame
btw, are you learning for the first time, or digging into some of the edge case specifics? For the former, #clschool is probably more appropriate
2:23:29
aeth
hectorhonn: The way CL does its (mostly) case insensitive behavior is by upcasing, so if you want to literally refer to something you either have to upcase the string manually or you have to do (symbol-name 'foo)
2:34:57
pillton
hectorhonn: The reason for all the "don't go here talk" is because of readtable-case, *print-case* and the specification of the COMMON-LISP package. (in-package #:abc) gives the illusion of writing case insensitive code but you end up in a world of hurt anyway because the COMMON-LISP package and all of its exported symbols are specified to be upper case.
2:35:31
pillton
hectorhonn: Things become even worse when you consider multiple users and using libraries written using different non default readtable-case and *print-case*.
4:41:48
LdBeth
ACTION uploaded an image: 螢幕快照 2019-01-14 下午8.41.17.png (570KB) < https://matrix.org/_matrix/media/v1/download/matrix.org/qgwtUgNeUPqGJVaNeqCeprde >
8:01:56
verisimilitude
You should in all cases where case isn't an issue prefer the uninterned symbol, hectorhonn.
8:03:28
verisimilitude
I still find myself here, because I still use #ada and why not lurk here as well?
8:12:53
hectorhonn
hmm, how to put this? i want to write the tests in the source file itself, then i can press c-x c-e directly without changing buffers
8:13:35
hectorhonn
verisimilitude: why so? lisp has no static checking, i have no idea if i break anything else when i change something somewhere
8:15:17
verisimilitude
Generally, you should have well-defined boundaries and, depending on the nature of the code, will find it simple to make changes or at the least get put in the debugger when they're invalid.
8:15:46
verisimilitude
I just find them overrated, hectorhonn, but you may think differently. It's just my opinion.
8:17:53
xsperry
I wouldn't want to maintain a large project without unit tests, especially one written in dynamically typed language
8:18:08
verisimilitude
Perhaps the best comment I can make is how there's a difference between actually testing software and this ``testing'' of software.
8:19:01
xsperry
what is this units thing mentioned earlier? is that irc bot thing, or actual lisp library?
8:23:54
flip214
Why does (babel:string-to-octets (base64:base64-decode "8TpYsprZQt9cX6YKFC/QKgvGS/c=")) give a different result from # echo 8TpYsprZQt9cX6YKFC/QKgvGS/c= | base64 -d | hexdump ??
8:48:30
flip214
no-defun-allowed: I'd probably use radare, IDA pro, or similar for an initial split ;)
8:49:05
no-defun-allowed
i don't have any of those, but there's big #xff runs which i assume are to preserve flash lifespan
8:49:09
flip214
no-defun-allowed: and 28MB isn't that big - even in a 32bit character encoding that's less than 128MB, so should fit nicely into any smartphone even ;)
8:52:32
flip214
no-defun-allowed: I guess I'd just use a LOOP myself, and split on 4kB boundaries or so
8:53:41
flip214
no-defun-allowed: if you're doing many such searches, perhaps you'd want to convert into a vector of 32bit values first?
8:53:45
no-defun-allowed
i can see there's two cromfs areas in hexl-mode, but i need to get them out somehow, preferably not by searching for the end myself
8:55:03
flip214
no-defun-allowed: well, the "hd" binary conveniently leaves out repeated areas already -- so just do # hd rom | grep -A1 -B1 "^\*"
8:57:41
aeth
28 MB isn't just not that big... it's approaching "fits in cache" territory, but not quite there yet since only a few have 32 MB and most are still 8-16 MB
8:58:55
no-defun-allowed
on the next problem, what kind of name is unmkcromfs and how do i get it to extract the cromfs?
9:19:20
no-defun-allowed
aeth: https://www.youtube.com/watch?v=FnPHL4cbzLM?t=720 suggests a high-end machine would have 64MB memory in 1997, so 32MB could be average
10:31:02
schweers
I have a slightly off-topic question. I have a class COST which calculates costs based on given initargs (using INITIALIZE-INSTANCE). This code has been tested and all is well. I now want to test another function, which creates a COST object using said initargs. In order to simplify testing, I’d like to make it configurable how such a COST object is created. The easiest way I can think of is adding a keyword argume
10:35:56
White_Flame
2 ways: pass in a "factory function" (whee java terminology), eg (lambda () (make-instance ...)), or pass in a list of initargs and use APPLY on MAKE-INSTANCE
10:38:18
schweers
The thing is that my old code already passes objects it produces on its own to MAKE-INSTANCE, so I’m not sure how APPLY and a list of initargs may help me. On the other hand ... is a lambda really different from supplying a different symbol?
10:39:39
schweers
Now that I think of it: the old code is a regular defun, while the new code I’m refactoring it into is an INITIALIZE-INSTANCE method on a new class, so I might as well use a keyword.
10:40:28
schweers
The code I want to test creates objects and I want to change how these objects are created (just for testing, at least for now)
10:43:00
schweers
White_Flame: your suggestion sounds a lot like what I had in mind, so my idea seems to not have been so far off :) Thanks for your feedback!
12:31:14
Selwyn
is there a way to print Lisp forms without the quote symbol and backquote symbol being replaced by ' and `?
12:32:56
Selwyn
at the REPL, '`(a ,b) ==> `(a ,b) whereas the desired output would be something like (MY-IMPL::QUASIQUOTE (A (MY-IMPL::UNQUOTE B)))
12:37:40
heisig
Selwyn: Maybe fare-quasiquote ( https://github.com/fare/fare-quasiquote ) can help you. As flip214 said, quasiquotation is, by default, very implementation-dependent.
13:59:03
ogamita
Selwyn: (print-conses '`(a ,b)) #| (list* . ((quote . (a . ())) . ((list . (b . ())) . ()))) --> (list* 'a (list b)) |#
13:59:32
ogamita
(symbol-package 'print-conses) #| --> #<Package "COM.INFORMATIMAGO.COMMON-LISP.PICTURE.CONS-TO-ASCII"> |#
14:00:32
ogamita
Selwyn: note however that: (print-conses '(a #(b (c d e) f) g)) #| (a . (#(b (c d e) f) . (g . ()))) --> (a #(b (c d e) f) g) |# ie. it doesn't enter into vectors and other structures.
14:00:50
pfdietz
xsperry: in that thing from yesterday, you could also imagine f and g (and (c f g)) return the value returned by the argument thunk when it is called.
14:03:54
Selwyn
ogamita: thanks for the link. sbcl in particular relies on some structures to implement unquoting