Re: CDR for Package-Local Nicknames [Feedback Request]

2024-07-08 Thread Martin Simmons
ackage functions to detect PLNs, add an optional second argument "package" to FIND-PACKAGE, which would be used in the lookup of the first argument and would default to nil, meaning no PLN lookup. That would allow code such as: (intern name (find-package "FOO")) to work without any ambiguity about what FOO means. -- Martin Simmons LispWorks Ltd http://www.lispworks.com/

Re: static-vectors:free-static-vector for LispWorks

2024-05-30 Thread Martin Simmons
Do not use raw::free-an-object because it will lead to crashes. There is no equivalent function that is safe. If the turnover of vectors is too large for the GC to keep up then I suggest reusing them explicitly. -- Martin Simmons LispWorks Ltd http://www.lispworks.com/ >>>>>

Re: DEFTYPE and SATISFIES

2024-02-22 Thread Martin Simmons
Assuming CURRY1 returns a function, then that is not portable. The predicate-name given to SATISFIES is expected to be a symbol with a global function definition and there is no way to pass extra arguments. LispWorks TYPEP is not checking for this (but SUBTYPEP does). -- Martin Simmons

Re: Help with bit bashing code: differences between C and CL

2023-11-10 Thread Martin Simmons
1 22)) or (float (expt 2 -52) 1d0) then LispWorks also appears to diverge at 21 like on other Lisps. Looking at the binary representation of the floats shows that this divergence at 21 is just in the printing. The C library prints some extra digits that are not needed. -- Martin Simmons LispWork

Re: Expansion of double backticks and commas

2023-02-14 Thread Martin Simmons
As Steve mentioned, the pretty printer is also involved here. Try setting *print-pretty* to nil to see what sbcl is really doing. -- Martin Simmons LispWorks Ltd http://www.lispworks.com/ >>>>> On Fri, 10 Feb 2023 21:13:11 +0100, Andrea Monaco said: > > I see that

Re: Language extension / "behavior"

2023-01-25 Thread Martin Simmons
>>>>> On Wed, 25 Jan 2023 16:00:58 +0100, Didier Verna said: > > Martin Simmons wrote: > > > I think it does, because section 3.5.1.4 Unrecognized Keyword > > Arguments says that an error must be signaled for unrecognized > > keywords in a safe call

Re: Language extension / "behavior"

2023-01-24 Thread Martin Simmons
for unrecognized keywords in a safe call, so that will not happen for an extension keyword. -- Martin Simmons LispWorks Ltd http://www.lispworks.com/

Re: Another (stupid) question: "find first set" (or "find first zero")

2021-02-02 Thread Martin Simmons
ngle word here), > and stop processing now, because all the other words will give 0 as result. Even better, we can just do logbitp ≠ 0 in word-sized chunks. I.e. scan from the least significant word until (bignum-word-ref bignum i) is non-zero and then, as you say, process that non-ze

Re: Another (stupid) question: "find first set" (or "find first zero")

2021-02-02 Thread Martin Simmons
>     -- > > >>     Marco Antoniotti, Associate Professortel.+39 - 02 64 48 79 01 > > >>     DISCo, Università Milano Bicocca U14 > > >>     2043http://bimib.disco.unimib.it > > <http://bimib.disco.unimib.it> <http://bimib.disco.unimib.it/ > > <http://bimib.disco.unimib.it/>> > > >>     Viale Sarca 336 > > >>     I-20126 Milan (MI) ITALY > > > > > > > > > > > > -- > > > Marco Antoniotti, Associate Professortel.+39 - 02 64 48 79 01 > > > DISCo, Università Milano Bicocca U14 > > 2043http://bimib.disco.unimib.it <http://bimib.disco.unimib.it> > > > <http://bimib.disco.unimib.it/ <http://bimib.disco.unimib.it/>> > > > Viale Sarca 336 > > > I-20126 Milan (MI) ITALY > > > > > > -- > > __Pascal Bourguignon__ > > > > > > > > -- > > Marco Antoniotti, Associate Professortel.+39 - 02 64 48 79 01 > > DISCo, Università Milano Bicocca U14 2043http://bimib.disco.unimib.it > > <http://bimib.disco.unimib.it/> > > Viale Sarca 336 > > I-20126 Milan (MI) ITALY > > > -- > __Pascal Bourguignon__ > -- Martin Simmons LispWorks Ltd http://www.lispworks.com/

Re: One annoyance of ensure-generic-function-using-class

2018-01-02 Thread Martin Simmons
ays: "If the class of the generic-function argument is not the same as the class specified by the :generic-function-class argument, an error is signaled." It makes more sense if that only applies when the :generic-function-class argument is supplied. That also makes it work like the other keywords, i.e. omitting them doesn't change anything. -- Martin Simmons LispWorks Ltd http://www.lispworks.com/

Re: Errata for hyperspec?

2017-12-21 Thread Martin Simmons
in both? > > We believe that there are no SUBSTANTIAL differences between the > Hyperspec and the ANSI standard. > > That is, no differences other than typographical style, copyright > notices, and other ANSI and Lispworks, respectively, boilerplate. Yes, that is correct. -- Martin Simmons LispWorks Ltd http://www.lispworks.com/

Re: Can compiler macros make use of type declarations?

2017-11-09 Thread Martin Simmons
s you know the types of all of the values assigned to it. > Without that, compiler macros can only make optimization > decisions based on arguments which are literal values, which is still useful > but not in all cases. Yes, that's really all they can be used for. -- Martin Simmons LispWorks Ltd http://www.lispworks.com/

Re: Can compiler macros make use of type declarations?

2017-11-09 Thread Martin Simmons
Compiler macros are expanded too early to get inferred type info. For example, (let ((y 10)) (loop (bar y) (setq y :not-a-fixnum))) -- Martin Simmons LispWorks Ltd http://www.lispworks.com/ >>>>> On Thu, 9 Nov 2017 14:47:53 +0530, Chaitanya Gupta said: > > I tried this

Re: Proper behavior of slot-initforms in defstruct?

2015-08-04 Thread Martin Simmons
(make-q2 If you compile and load each of these files, then t1 should always return t whereas t12 might return nil or t depending on whether the code for the initform in q1 is shared or copied. -- Martin Simmons LispWorks Ltd http://www.lispworks.com/

Re: Do symbols need to be EQ?

2015-07-03 Thread Martin Simmons
portant. Also, the identity of uninterned symbols is just as important (e.g. for macros) as interned ones, so finding symbols via packages (and the reader) is not fundamental to their common use. Packages are just a way to convert strings to symbols, which is useful when they are obtained from files outside a running CL (e.g. via the reader/fasl loader). -- Martin Simmons LispWorks Ltd http://www.lispworks.com/

Re: [pro] lisp on mobile platforms these days

2014-05-01 Thread Martin Simmons
I've not tried myself, but most programs will run (isn't AWS just another VM)? -- Martin Simmons LispWorks Ltd http://www.lispworks.com/ >>>>> On Wed, 30 Apr 2014 13:37:03 -0400, Scott McKay said: > > Martin, do you have LispWorks running in AWS? > > --Sc

Re: [pro] lisp on mobile platforms these days

2014-04-30 Thread Martin Simmons
;re not going to publish further details yet, so please don't ask here. -- Martin Simmons LispWorks Ltd http://www.lispworks.com/ ___ pro mailing list pro@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/pro

Re: Wild pathnames

2014-03-18 Thread Martin Simmons
he call to DIRECTORY in LW returns > > CL-USER 1 > (directory "/tmp/x/") > NIL ; Which may be not be appropriate... LW's DIRECTORY never returns the directory itself (i.e. "."), but maybe some other implementations do? -- Martin Simmons LispWorks Ltd http://www.lispworks.com/

Re: [pro] [Q] introspecting setf expanders

2012-10-09 Thread Martin Simmons
27;s a bit shaky. E.g. a user could define (defsetf foo (x) (y) `(funcall #'(setf foo) ,y ,x)) which gives a false negative. Also, it won't be portable, because the (FUNCALL #'(SETF FOO) ...) form isn't required (the standard just specifies something with the same effect as

Re: [pro] Default behavior of standard output streams

2012-05-22 Thread Martin Simmons
request, not a bug (the ANSI standard even says that it is common for the initial values of *error-output* and *standard-output* be the same stream). IMHO, having two independently-buffered streams connected to the same underlying destination in the interactive case #1 is a recipe for confusion.

Re: [pro] Defined but no used variable warning during setf expansion

2012-01-24 Thread Martin Simmons
EVAL look strange and I suspect the whole thing could be written more clearly without needing a separate DEFMACRO and DEFSETF for each DEFACTIVE form. That approach would need to use DEFINE-SETF-EXPANDER instead of DEFSETF. -- Martin Simmons LispWorks Ltd http://www.lispworks.com/ ___ pro mailing list pro@common-lisp.net http://lists.common-lisp.net/cgi-bin/mailman/listinfo/pro

Re: [pro] Declarations in compilers (feedback welcome)

2011-12-30 Thread Martin Simmons
> On Thu, 29 Dec 2011 11:24:37 +0100, Juan Jose Garcia-Ripoll said: > > After struggling mentally with this for a few weeks, I would like to have > some consultation before I introduce some changes in ECL -- not that I > expect many users here, but at least some implementor-fellows and power >

Re: [pro] "fhash"

2011-06-14 Thread Martin Simmons
e can specialize methods on defstruct classes too, so they don't have to be CLOS instances defined with defclass. -- Martin Simmons LispWorks Ltd http://www.lispworks.com/ ___ pro mailing list pro@common-lisp.net http://lists.common-lisp.net/cgi-bin/mailman/listinfo/pro

Re: [pro] Lisp 2's and function values.

2011-05-25 Thread Martin Simmons
st specifying different namespaces, the proposal is to have a different evaluator for the car of the form. In fact, CL already has one, but it is very limited. If that evaluator allows macro forms, then a macro that expands to a symbol should work as if the symbol was used directl

Re: [pro] Reader macro definition in CLHS

2011-03-02 Thread Martin Simmons
fference in that simple case, but consider the standard Sharpsign X case: #X123 is the reader macro in sense 1 #X is the reader macro in sense 2 I.e. sense 2 describes the characters that the built-in reader algorithm processes and sense 1 contains those characters plus anything that

Re: [pro] Final empty parameters to format directives

2011-01-28 Thread Martin Simmons
> On Thu, 27 Jan 2011 15:19:47 +0100, Didier Verna said: > > Hello, > > I just fell upon a case where implementations seem to differ on what to > do. The question is how to interpret a format directive in which the > last parameter is followed by a comma. Consider this test case: > > (

Re: [pro] simple-style-warning

2011-01-26 Thread Martin Simmons
ol/arg > slots and a :report function myself. Is this correct? That is unexpected to me. What exactly is the problem when you define simple-style-warning to inherit from style-warning and simple-warning? -- Martin Simmons LispWorks Ltd http://www.lispworks.com/

Re: [pro] simple-style-warning

2011-01-21 Thread Martin Simmons
c2e0bb?lnk=gst&q=style-warning#bea4d994f8c2e0bb) > > but it works inconsistently in SBCL and CCL. In what way inconsistently? I would expect that to work. -- Martin Simmons LispWorks Ltd http://www.lispworks.com/ ___ pro mailing list pro@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/pro

Re: [pro] Initialization of shared slots

2011-01-10 Thread Martin Simmons
e 'tarball)) > ... > (defun vcs-enabled-p (type) > "Problem function." > (class-slot type 'enabled-p)) > > ...I want to be able to use VCS-ENABLED-P on any slice before > instantiable classes are instantiated. Another reason why this won't work is that

Re: [pro] Initialization of shared slots

2011-01-07 Thread Martin Simmons
be the only reason, > is that the initial value is figured out in a way > that may depend on class precedence. Indeed (and also whether subclasses share the same value or have their own). -- Martin Simmons LispWorks Ltd http://www.lispworks.com/ _

Re: [pro] Initialization of shared slots

2011-01-06 Thread Martin Simmons
posed to be used by instances only (including the > first one). Maybe this is not a good idea after all... Overall, I think shared slots are a bad idea. As discussed in a previous topic, defclass by itself doesn't provide very good encapsulation. Another gotcha is that reevaluating a d

Re: [pro] Initialization of shared slots

2011-01-06 Thread Martin Simmons
says that the shared slot initform is evaluated in "the dynamic environment in which the defclass form was evaluated". I think it should really start "The value of the :initform for a shared slot..." The point here is that the value is remembered and is "used" when

Re: [pro] Initialization of shared slots

2011-01-06 Thread Martin Simmons
>>>>> On Thu, 6 Jan 2011 12:36:48 GMT, Martin Simmons said: > >>>>> On Wed, 5 Jan 2011 16:31:31 -0800, Scott L Burson said: > > > > I think the sentence from 7.1.3 that you've quoted is intended to > > apply only to local slots;

Re: [pro] Initialization of shared slots

2011-01-06 Thread Martin Simmons
y happens when the slot is unbound, i.e. typically the first time). -- Martin Simmons LispWorks Ltd http://www.lispworks.com/ ___ pro mailing list pro@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/pro

Re: [pro] couple questions about dynamic bindings

2010-12-27 Thread Martin Simmons
(x 0)) > (declare (special x)) > (progv '(x) () (setq x 1)) > x) ==> 0 The type of binding is the same, but the real power of progv is that it evaluates the list of variables, unlike let where the variable names are fixed when the code is cr

Re: [pro] macros expanding to defclass + some mop code

2010-12-27 Thread Martin Simmons
ro list-all-slot-values-of-class-name (class) `(list ,@(mapcar (lambda (ds) `(,(car (slot-definition-readers ds)) x)) (class-direct-slots (find-class class) (defmacro deffoo (class slots) `(progn (eval-when (:compile-toplevel :load-toplevel :execute) (def

Re: [pro] (values) for for-effect functions

2010-12-03 Thread Martin Simmons
void) will prevent tail call optimization, so may be undesirable. -- Martin Simmons LispWorks Ltd http://www.lispworks.com/ ___ pro mailing list pro@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/pro

Re: [pro] Chains of multiple-value-bind...

2010-11-26 Thread Martin Simmons
nd it. It might be better to group the guard and the body like cond does, i.e. (destructuring-bind ((&rest lambda-list) expression (guard &rest body)) first Also the nesting of the multiple-value-binds in the expansion leads to unexpected lexical scopin