From: Edi Weitz
Subject: Re: Two questions together
Date: 
Message-ID: <ufyqxeq9c.fsf@agharta.de>
On 19 Oct 2005 03:01:04 -0700, "Kubilay" <···········@gmail.com> wrote:

> For example, by using macros, can I develop a "new" language called
> "Lisp++" based upon Lisp but also seems like just as C or Ruby?

This is a typical question raised by many "newbies."  Search the
archives of this newsgroups and you'll find similar ideas several
times.  The short answer (IMHO) is that it can be done but once you
grok what's cool about Lisp you don't want to do it anymore.  It's a
waste of time.

You might also want to look at Dylan for one example of a "Lisp++."

> Frankly, this is not a "Lisp spesific" question. As we know, Common
> Lisp has many libraries and predefined functions. For example,
> yesterday I found that any Lisp listener can "read" a number in
> English through a simple "format" function. So, how can I know that
> whether a feature which I need is already exists in Lisp? For
> example, again, I may need a random number generator but I don't
> know "where" this function is. Or perhaps I will need a "foo"
> functiun which is already waiting somewhere out there but since I am
> not aware of it I will try to discover America again.

Yes, this is not a Lisp-specific question, it applies to all
programming languages.  The usual answer is: RTFM.

For Common Lisp there's an ANSI standard and an online version is
available here:

  <http://www.lispworks.com/documentation/HyperSpec/Front/index.htm>

Plus, your specific Lisp implementation will usually offer much more
functions than those that are specified by the standard.  They'll also
have manuals.  Here are some examples:

  <http://www.lispworks.com/documentation/index.html>
  <http://franz.com/support/documentation/>
  <http://www.cons.org/cmucl/doc/index.html>
  <http://www.sbcl.org/manual/>
  <http://clisp.sourceforge.net/impnotes/>
  <http://openmcl.clozure.com/Doc/index.html>
  <http://www.cormanlisp.com/CormanLisp/CormanLisp_2_5.pdf>
  <http://ecls.sourceforge.net/ecl/index.html>
  <ftp://ftp.gnu.org/pub/gnu/gcl/gcl.info.tgz>
  <http://www.scieneer.com/scl/index.html>
  <http://armedbear.org/abcl.html>
  <http://www.digitool.com/>

And so on and so on...

Cheers,
Edi.

-- 

Lisp is not dead, it just smells funny.

Real email: (replace (subseq ·········@agharta.de" 5) "edi")

From: Kenny Tilton
Subject: Re: Two questions together
Date: 
Message-ID: <GHr5f.4195$h25.1550@news-wrt-01.rdc-nyc.rr.com>
Edi Weitz wrote:

> On 19 Oct 2005 03:01:04 -0700, "Kubilay" <···········@gmail.com> wrote:
> Yes, this is not a Lisp-specific question, it applies to all
> programming languages.  The usual answer is: RTFM.

Nonsense!

To the OP, your respondents are the ones who need to RTFM. Check out 
apropos. In AllegroCL 7:

> CELLO(1): (apropos 'random)
> CG.WIN::COPY-RANDOM-OBJECT [function] (X)
> RANDOM-STATE-P      [function] (OBJECT)
> *RANDOM-STATE*      value: #<RANDOM-STATE @ #x200ea602>
> RANDOM-STATE
> MAKE-RANDOM-STATE   [function] (&OPTIONAL STATE)
> RANDOM              [function] (NUMBER &OPTIONAL STATE)
> COMP::PT-RANDOM     [function] (NODE KIDS TYPES)
> COMP::PT-NEW-RANDOM-FLOAT [function] (NODE KIDS TYPES)
> COMP::PT-NEW-RANDOM-DOUBLE-FLOAT [function] (NODE KIDS TYPES)
> EXCL::INTERNAL-MAKE-RANDOM-STATE [function] (&KEY SEED FIXSEED MTI)
> EXCL::NEW-RANDOM-FIXNUM [function] (NUMBER STATE)
> EXCL::RANDOM-STATE-SEED [function] (STRUCT)
> EXCL::RANDOM-STATE-
> EXCL::OUTPUT-RANDOM [function] (OBJECT XP)
> EXCL::RANDOM-STATE-MTI [function] (STRUCT)
> EXCL::GET-TWO-RANDOM-BIGITS [function] (STATE)
> EXCL::NEW-RANDOM-DOUBLE-FLOAT [function] (STATE)
> EXCL::RANDOM-FLOAT  [function] (NEWSEED)
> EXCL::NEW-RANDOM-FLOAT [function] (STATE)
> EXCL::REAL-INTERNAL-MAKE-RANDOM-STATE [function] (&KEY MTI FIXSEED)
> EXCL::NEW-RANDOM-BIGNUM [function] (NUMBER STATE)
> EXCL::*INTERNAL-RANDOM-STATE* value: 102898792291445
> EXCL::RANDOM-REGENERATE [function] (FIXNUM STATE)
> EXCL::*O-RANDOM*    value: 16
> EXCL::RANDOM-STATE-FIXSEED [function] (STRUCT)
> EXCL::COPY-RANDOM-STATE [function] (STATE)
> EXCL::MAKE-RANDOM-STATE-FROM-SEED [function] (SEED)
> WIN::ADD-RANDOM-RESOURCE [function] (OLDFILE NEWFILE TYPE NAME ...)
> CELLO(2): 

Note that you can do (apropos 'rand) and find anything with "rand" in 
the symbol name. A couple of reasonable guesses will turn up most of 
what you are looking for, if it is there. If that does not work, do try 
the hyperspec since some functions are named surprisingly.


-- 
Kenny

Why Lisp? http://wiki.alu.org/RtL_Highlight_Film

"I've wrestled with reality for 35 years, Doctor, and I'm happy to state 
I finally won out over it."
     Elwood P. Dowd, "Harvey", 1950
From: Zach Beane
Subject: Re: Two questions together
Date: 
Message-ID: <m364rta9k3.fsf@unnamed.xach.com>
Kenny Tilton <·······@nyc.rr.com> writes:

> Edi Weitz wrote:
> 
> > On 19 Oct 2005 03:01:04 -0700, "Kubilay" <···········@gmail.com> wrote:
> > Yes, this is not a Lisp-specific question, it applies to all
> > programming languages.  The usual answer is: RTFM.
> 
> Nonsense!
> 
> To the OP, your respondents are the ones who need to RTFM. Check out
> apropos. In AllegroCL 7:
> 
> > CELLO(1): (apropos 'random)

I've gotten in the habit of using a string for apropos. When using a
symbol, it gets interned, and is immediately appears in the results of
apropos.

Zach
From: Rob Warnock
Subject: Re: Two questions together
Date: 
Message-ID: <M8mdnfV65scw_creRVn-uA@speakeasy.net>
Zach Beane  <····@xach.com> wrote:
+---------------
| Kenny Tilton <·······@nyc.rr.com> writes:
| > > CELLO(1): (apropos 'random)
| 
| I've gotten in the habit of using a string for apropos. When using a
| symbol, it gets interned, and is immediately appears in the results of
| apropos.
+---------------

To avoid that, my habit is to use keywords. Yes, they *also* get
interned and immediately appear in the results of the APROPOS,
but those keywords don't pollute the package I'm in at the time,
and thus don't interfere if I want to import one of the other results.
[And who cares about polluting the keyword package, anyway...]


-Rob

-----
Rob Warnock			<····@rpw3.org>
627 26th Avenue			<URL:http://rpw3.org/>
San Mateo, CA 94403		(650)572-2607
From: Edi Weitz
Subject: Re: Two questions together
Date: 
Message-ID: <u1x2hd3po.fsf@agharta.de>
On Wed, 19 Oct 2005 13:17:26 GMT, Kenny Tilton <·······@nyc.rr.com> wrote:

> Nonsense!

Yawn...

-- 

Lisp is not dead, it just smells funny.

Real email: (replace (subseq ·········@agharta.de" 5) "edi")
From: Bulent Murtezaoglu
Subject: Re: Two questions together
Date: 
Message-ID: <873bmxr5p0.fsf@p4.internal>
>>>>> "KT" == Kenny Tilton <·······@nyc.rr.com> writes:
[...]
    KT> To the OP, your respondents are the ones who need to
    KT> RTFM. Check out apropos.  [...]

Right.  We also have the google facility built into many of our IDEs.  
Eg:

http://www.google.com/search?&q=site%3Awww.lispworks.com+hyperspec+randomr

[...]
    KT> Note that you can do (apropos 'rand) and find anything with
    KT> "rand" in the symbol name. 

Yes, it'll also turn up lots of internal functions and odd symbols.  
Perhaps

CL-USER> (apropos 'rand 'common-lisp)
RANDOM-STATE-P (fbound)
RANDOM-STATE
*RANDOM-STATE* (bound)
RANDOM (fbound)
ARITHMETIC-ERROR-OPERANDS (fbound)
MAKE-RANDOM-STATE (fbound)
; No value
CL-USER> 

    KT> A couple of reasonable guesses will
    KT> turn up most of what you are looking for, if it is there. If
    KT> that does not work, do try the hyperspec since some functions
    KT> are named surprisingly.

Also I find most of the newbies don't use the permuted symbol index in 
the hyperspec.  A shame really:

http://www.lispworks.com/documentation/HyperSpec/Front/X_Perm_R.htm

(Edi may have pointed this out already, I am too lazy to check).

cheers,

BM
From: Kenny Tilton
Subject: Re: Two questions together
Date: 
Message-ID: <g2t5f.4205$h25.985@news-wrt-01.rdc-nyc.rr.com>
Bulent Murtezaoglu wrote:
>>>>>>"KT" == Kenny Tilton <·······@nyc.rr.com> writes:
> 
> [...]
>     KT> To the OP, your respondents are the ones who need to
>     KT> RTFM. Check out apropos.  [...]
> 
> Right.  We also have the google facility built into many of our IDEs.  
> Eg:
> 
> http://www.google.com/search?&q=site%3Awww.lispworks.com+hyperspec+randomr
> 
> [...]
>     KT> Note that you can do (apropos 'rand) and find anything with
>     KT> "rand" in the symbol name. 
> 
> Yes, it'll also turn up lots of internal functions and odd symbols.  

I am spoiled, I have the AllegroCL apropos /dialog/ which lets me poke 
first the external-only checkbox and then, if that is not enough (unlike 
this case), the functions-only checkbox. Hellasweet.

> Perhaps
> 
> CL-USER> (apropos 'rand 'common-lisp)

good idea. One could take the other suggestion and add to one's image:

  (defun apropos-cl (whatever)
    (apropos (string whatever) 'common-lisp))

...while learning CL. Adding keywords for fn-only-p, class-only-p, 
exported-only-p left as an exercise (hint: (apropos 'apropos))

-- 
Kenny

Why Lisp? http://wiki.alu.org/RtL_Highlight_Film

"I've wrestled with reality for 35 years, Doctor, and I'm happy to state 
I finally won out over it."
     Elwood P. Dowd, "Harvey", 1950