Search found 166 matches

by pjstirling
Mon Jan 22, 2018 5:22 am
Forum: Common Lisp
Topic: /dev/stdin utf-8
Replies: 3
Views: 5791

Re: /dev/stdin utf-8

I apologise for taking so long to reply, but you are getting the support you paid for :) Firstly I must point out that you didn't do what I asked - post the result of: (map 'vector #'char-code s) But what you did post mostly confirmed my suspicions: A SIMPLE-BASE-STRING is a BASE-STRING A BASE-STRIN...
by pjstirling
Wed Jan 17, 2018 4:36 am
Forum: Common Lisp
Topic: /dev/stdin utf-8
Replies: 3
Views: 5791

Re: /dev/stdin utf-8

I've never used lispworks, but I was bored, so here I go! It's probably worth confirming that your string is getting raw utf8 bytes. According to babel: cl-user>(babel:string-to-octets "⍳") #(226 141 179) try: (map 'vector #'char-code s) You may be able to use your init file[1] to change the defau...
by pjstirling
Tue Jan 09, 2018 10:09 am
Forum: Common Lisp
Topic: Why is it usual to make everything a "registered system"?
Replies: 6
Views: 6695

Re: Why is it usual to make everything a "registered system"

Well, if you want to distribute essentially binaries, you should go the image route. If, however, the idea is that you will distribute source-code that will maybe be modified at the other end, then there's no good other choice than providing ASDF systems. If you are concerned about the ASDF namespac...
by pjstirling
Tue Jan 09, 2018 9:50 am
Forum: Common Lisp
Topic: Why is it usual to make everything a "registered system"?
Replies: 6
Views: 6695

Re: Why is it usual to make everything a "registered system"

Once you dump an image with your code, then you can delete everything else (if you so want). It's also possible to e.g. have a script that starts your lisp with a modified ASDF configuration so that you have modules that are private to your application. You are right to say that make doesn't force y...
by pjstirling
Tue Jan 09, 2018 9:30 am
Forum: Common Lisp
Topic: Why is it usual to make everything a "registered system"?
Replies: 6
Views: 6695

Re: Why is it usual to make everything a "registered system"

ASDF serves the same purpose as Make/Maven. It solves the problem of ensuring that files are compiled and loaded in the right order, while rebuilding if dependencies have changed. The primitives supplied by the Common-Lisp standard are all imperative, and offer a lot of scope for users to screw this...
by pjstirling
Sat Dec 16, 2017 1:53 am
Forum: Common Lisp
Topic: Read Text File In Current Directory
Replies: 6
Views: 8741

Re: Read Text File In Current Directory

All three major operating systems have a notion of the current directory, and this is where programs will attempt to open files that don't have an absolute prefix (e.g. C: on windows). Lispworks is clearly (from your error message) using its own directory as its initial current directory. You have t...
by pjstirling
Wed Oct 25, 2017 1:43 pm
Forum: Common Lisp
Topic: delete does not work
Replies: 12
Views: 16664

Re: delete does not work

Using a loop over POP is O(n) in both.
by pjstirling
Wed Oct 25, 2017 11:41 am
Forum: Common Lisp
Topic: delete does not work
Replies: 12
Views: 16664

Re: delete does not work

Repeated REMOVE or DELETE is O(n^2) regardless (unless you supply count it must walk the whole list for each call)

The right way to empty a list is always a loop over POP
by pjstirling
Tue Oct 24, 2017 1:58 pm
Forum: Common Lisp
Topic: delete does not work
Replies: 12
Views: 16664

Re: delete does not work

The DELETE functions are intended as a possible optimisation, an optimisation that no longer really makes sense. The effort that ultimately resulted in the Common-lisp standard was started in 1981 (incidentally the year I was born). My first computer had eight thousand times less memory than my curr...
by pjstirling
Tue Oct 24, 2017 11:24 am
Forum: Common Lisp
Topic: delete does not work
Replies: 12
Views: 16664

Re: delete does not work

DELETE(-IF/-IF-NOT) isn't required to modify the list that you pass it, it can simply build a new list without the deleted item(s). The key line is delete, delete-if, and delete-if-not are like remove, remove-if, and remove-if-not respectively, but they may modify sequence. To my knowledge in e.g. s...