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

This is a discussion on what's the standard way to make results in the REPL "invisible" within the lisp forums in Programming Languages category; szergling <senatorZergling @ gmail.com> wrote: +--------------- | Besides all the suggestions previously mentioned in this thread, I | also use (null (expr)), which is quite quick to type in the REPL. +--------------- NOT is even shorter! ;-} ;-} -Rob ----- Rob Warnock <rpw3 @ rpw3.org> 627 26th Avenue <URL:http://rpw3.org/> San Mateo, CA 94403 (650)572-2607...

Go Back   Application Development Forum > Programming Languages > lisp

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #11  
Old 01-17-2008, 10:58 PM
Rob Warnock
Guest
 
Default Re: what's the standard way to make results in the REPL "invisible"

szergling <senatorZergling@gmail.com> wrote:
+---------------
| Besides all the suggestions previously mentioned in this thread, I
| also use (null (expr)), which is quite quick to type in the REPL.
+---------------

NOT is even shorter! ;-} ;-}


-Rob

-----
Rob Warnock <rpw3@rpw3.org>
627 26th Avenue <URL:http://rpw3.org/>
San Mateo, CA 94403 (650)572-2607

Reply With Quote
  #12  
Old 01-18-2008, 07:49 PM
szergling
Guest
 
Default Re: what's the standard way to make results in the REPL "invisible"

On Jan 18, 4:58 pm, r...@rpw3.org (Rob Warnock) wrote:
> szergling <senatorZergl...@gmail.com> wrote:
>
> +---------------
> | Besides all the suggestions previously mentioned in this thread, I
> | also use (null (expr)), which is quite quick to type in the REPL.
> +---------------
>
> NOT is even shorter! ;-} ;-}
>
> -Rob


Damnit, I've been scooped! That seems like the optimal solution -- the
global minimum! I've searched through all symbols (including some
non-CLHS ones), and there's no other shorter ones.

(let ((x (list)))
(do-symbols (s)
(let ((name (symbol-name s)))
(when (<= (length name) 3)
(push s x))))
(sort x #'< :key (lambda (sym)
(length
(symbol-name sym)))))

(* > T < / = - * + S P X GC PI ++ 1+ ** >= // OR DO EQ /= IF <= GO ED
1- IT FN PS VAR ARG INT MAP MOD LCM *** LDB GET MIN SIN SET DO* ///
+++ ELT EXP AND DPB COS POP ASH NTH NIL CDR NOT LOG THE CAR REM MAX
GCD ABS BIT EQL LET TAN CIS ZIP AIF DIR SYS SRC SYM)

Well, (= (expr)) almost made it, but it only works for expressions
returning numbers. Could be useful for suppressing bignums...

I'll be back to one up c.l.l one day. Just you wait.


Reply With Quote
  #13  
Old 01-19-2008, 02:54 PM
Kent M Pitman
Guest
 
Default Re: what's the standard way to make results in the REPL "invisible"

szergling <senatorZergling@gmail.com> writes:

> On Jan 18, 4:58 pm, r...@rpw3.org (Rob Warnock) wrote:
> > szergling <senatorZergl...@gmail.com> wrote:
> >
> > +---------------
> > | Besides all the suggestions previously mentioned in this thread, I
> > | also use (null (expr)), which is quite quick to type in the REPL.
> > +---------------
> >
> > NOT is even shorter! ;-} ;-}
> >
> > -Rob

>
> Damnit, I've been scooped! That seems like the optimal solution -- the
> global minimum!


Uh, you could use DEFUN to make a shorter name in your init file for
interactive use, of course.

Or even a readmacro. e.g., in Maclisp I might have set up Control-N (^N)
as a readmacro to product (NOT xxx) or (NULL xxx) and then done

^N(expr)

if I was wanting to show incredible brevity at the reader. Nowadays
one never quite knows how user clients will handle control chars, so you
might have to sacrifice a visible character, which might be higher cost.

I certainly would never do this in code saved to a file, though.
Not for some silly application like this, anyway.
Reply With Quote
  #14  
Old 01-19-2008, 03:53 PM
Harald Hanche-Olsen
Guest
 
Default Re: what's the standard way to make results in the REPL "invisible"

+ Kent M Pitman <pitman@nhplace.com>:

> Or even a readmacro. e.g., in Maclisp I might have set up Control-N (^N)
> as a readmacro to product (NOT xxx) or (NULL xxx) and then done
>
> ^N(expr)
>
> if I was wanting to show incredible brevity at the reader. Nowadays
> one never quite knows how user clients will handle control chars, so you
> might have to sacrifice a visible character, which might be higher cost.
>
> I certainly would never do this in code saved to a file, though.
> Not for some silly application like this, anyway.


While we're being silly (I love silliness on the weekend), there's a
whole host of available characters one might use in combination with
the sharpsign. For example #> or #, (sharpsign comma).

--
* Harald Hanche-Olsen <URL:http://www.math.ntnu.no/~hanche/>
- It is undesirable to believe a proposition
when there is no ground whatsoever for supposing it is true.
-- Bertrand Russell
Reply With Quote
  #15  
Old 01-19-2008, 04:45 PM
Chris Russell
Guest
 
Default Re: what's the standard way to make results in the REPL "invisible"

On 19 Jan, 00:49, szergling <senatorZergl...@gmail.com> wrote:
> On Jan 18, 4:58 pm, r...@rpw3.org (Rob Warnock) wrote:
>
> > szergling <senatorZergl...@gmail.com> wrote:

>
> > +---------------
> > | Besides all the suggestions previously mentioned in this thread, I
> > | also use (null (expr)), which is quite quick to type in the REPL.
> > +---------------

>
> > NOT is even shorter! ;-} ;-}

>
> > -Rob

>
> Damnit, I've been scooped! That seems like the optimal solution -- the
> global minimum! I've searched through all symbols (including some
> non-CLHS ones), and there's no other shorter ones.

T beats it.

as in:

>(verbose-fn)t

T

at a single keypress you're going to be hard pressed to beat it.
Reply With Quote
  #16  
Old 01-19-2008, 11:25 PM
Rob Warnock
Guest
 
Default Re: what's the standard way to make results in the REPL "invisible"

Chris Russell <christopher.m.russell@gmail.com> wrote:
+---------------
| szergling <senatorZergl...@gmail.com> wrote:
| > I've searched through all symbols (including some
| > non-CLHS ones), and there's no other shorter ones.
|
| T beats it.
| as in:
| >(verbose-fn)t
| T
| at a single keypress you're going to be hard pressed to beat it.
+---------------

Hunh?!? Which CL gave the above result?!? I suspect you didn't
actually try this, or you would have discovered that it's incorrect
[or at the very least quite non-portable]. All of several CLs I tried
gave the following expected result instead:

> (loop for i below 100 collect i)t


(0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90
91 92 93 94 95 96 97 98 99)
>


T
>


[Well, one of them unexpectedly ate the "T" (perhaps because its
REPL uses GNU "readline"), but *none* of them ate the long result.]


-Rob

-----
Rob Warnock <rpw3@rpw3.org>
627 26th Avenue <URL:http://rpw3.org/>
San Mateo, CA 94403 (650)572-2607

Reply With Quote
  #17  
Old 01-20-2008, 12:05 AM
szergling
Guest
 
Default Re: what's the standard way to make results in the REPL "invisible"

On Jan 20, 8:54 am, Kent M Pitman <pit...@nhplace.com> wrote:
> szergling <senatorZergl...@gmail.com> writes:
> > On Jan 18, 4:58 pm, r...@rpw3.org (Rob Warnock) wrote:
> > > szergling <senatorZergl...@gmail.com> wrote:

>
> > > +---------------
> > > | Besides all the suggestions previously mentioned in this thread, I
> > > | also use (null (expr)), which is quite quick to type in the REPL.
> > > +---------------

>
> > > NOT is even shorter! ;-} ;-}

>
> > > -Rob

>
> > Damnit, I've been scooped! That seems like the optimal solution -- the
> > global minimum!

>
> Uh, you could use DEFUN to make a shorter name in your init file for
> interactive use, of course.


Yes it all depends on whether or not you count (fixed vs variable
costs) the defun form itself.
Reply With Quote
  #18  
Old 01-20-2008, 08:39 AM
Chris Russell
Guest
 
Default Re: what's the standard way to make results in the REPL "invisible"

On 20 Jan, 04:25, r...@rpw3.org (Rob Warnock) wrote:
> Chris Russell <christopher.m.russ...@gmail.com> wrote:
> +---------------| szergling <senatorZergl...@gmail.com> wrote:
>
> | > I've searched through all symbols (including some
> | > non-CLHS ones), and there's no other shorter ones.
> |
> | T beats it.
> | as in:
> | >(verbose-fn)t
> | T
> | at a single keypress you're going to be hard pressed to beat it.
> +---------------
>
> Hunh?!? Which CL gave the above result?!? I suspect you didn't
> actually try this, or you would have discovered that it's incorrect
> [or at the very least quite non-portable]. All of several CLs I tried
> gave the following expected result instead:
>
> > (loop for i below 100 collect i)t

>
> (0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
> 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
> 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
> 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90
> 91 92 93 94 95 96 97 98 99)
> >

>
> T
> >

>
> [Well, one of them unexpectedly ate the "T" (perhaps because its
> REPL uses GNU "readline"), but *none* of them ate the long result.]
>
> -Rob

Then it's a slime based inconsistency, that doesn't depend on the
compiler being used.
Since I never use the command line to work at the repl, I thought it
was standard behaviour.
Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 11:16 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.