From ... Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!t-online.de!newsfeeds.belnet.be!news.belnet.be!ossa.telenet-ops.be!nmaster.kpnqwest.net!nreader2.kpnqwest.net.POSTED!not-for-mail Newsgroups: comp.lang.lisp Subject: Re: Declaring type of top-level (special) variables? References: Mail-Copies-To: never From: Erik Naggum Message-ID: <3227610988977654@naggum.net> Organization: Naggum Software, Oslo, Norway Lines: 32 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Fri, 12 Apr 2002 14:36:29 GMT X-Complaints-To: newsmaster@KPNQwest.no X-Trace: nreader2.kpnqwest.net 1018622189 193.71.199.50 (Fri, 12 Apr 2002 16:36:29 MET DST) NNTP-Posting-Date: Fri, 12 Apr 2002 16:36:29 MET DST Xref: archiver1.google.com comp.lang.lisp:31512 * Adam Warner | Quick question. I'm trying to set a top-level variable of type integer | (in the expectation that when I perform a division upon the variable I | will obtain an integer result): This expectation cannot possibly be satisfied by a type declaration. You will have to use a division operator that always returns an integer, such as floor, ceiling, truncate, or round. | (defparameter *variablename* 1) | | Now variablename has type FIXNUM. I'd like to set that to INTEGER. This makes no sense, actually. The value held in *variablename* is a (or has type) fixnum, but the *variablename* does not. This is not how Common Lisp works. | I've tried declare but the compiler complains about it being in the top | level (CMUCL: Error: Misplaced declaration). Top-level declarations are done with proclaim or declaim, not declare, for whatever it might be worth. I think many other confusions need to be dispelled, so this although it might have been a quick question, the full answer is going to be quite lengthy... /// -- In a fight against something, the fight has value, victory has none. In a fight for something, the fight is a loss, victory merely relief. Post with compassion: http://home.chello.no/~xyzzy/kitten.jpg