Re: what's the standard way to make results in the REPL "invisible"



On Jan 16, 4:43 pm, Tamas <tkp...@xxxxxxxxx> wrote:
Hi,

I have the following problem: suppose there is a function I am calling
for its side effects, yet it returns a value, which is huge (think of
an array with 1e6 elements, etc).  Lisp handles the value perfectly,
but if this occurs in the REPL, the result will be printed, which
slows Emacs down.

What would be the standard way of preventing that?  Currently I am
using something like

(defmacro invisible (&body body)
  `(progn
     ,@body
     (values)))

(invisible
  (calculation-with-large-results ...))

but I wonder if there is a standard way.

Another, related question: is there a generic method for displaying a
conscise representation of an object?  Something like describe, but if
the object is really huge, it would display only part of it (eg first
10 elements of a vector, etc).

Thanks,

Tamas

If you want to inspect the result later, a quick shortcut is something
like

(defparameter *result* (function-returning-big-object))

DEFPARAMETER returns the symbol naming the variable.
.



Relevant Pages

  • whats the standard way to make results in the REPL "invisible"
    ... suppose there is a function I am calling ... What would be the standard way of preventing that? ... related question: is there a generic method for displaying a ...
    (comp.lang.lisp)
  • Re: PhP database design question
    ... design the DB, so was wondering if there is a standard to do this. ... There's no real standard for designing the DB for something like this. ... The reason for keeping the message itself separate is speed. ... Of course, displaying the actual message will be slightly slower, but you won't be doing that as much as just displaying to/from/subject. ...
    (comp.lang.php)
  • Re: my impressions of Excel 2007
    ... and Arial 10pt as standard font. ... Are you displaying a Task Pain on the ... Do the 2nd and subsequent lines use all of the space below the first ... If I want to close Excel I have to click the "X" twice? ...
    (microsoft.public.excel.misc)
  • Re: FAQ Topic - How do I format the lastModified date with javascript? (2009-01-12)
    ... It's the only sensible way of displaying a date independent of language ... well-written standard outside the realm for which the standard, overall, ... it's ISO 9075-2 that applies. ... John Stockton, nr London, UK. ...
    (comp.lang.javascript)
  • Re: SBCL User Survey 2010
    ... (defmacro defun (name parameters &body body) ... CL-USER> (foo) ... When you say "standard way", do you mean this is the type ...
    (comp.lang.lisp)