From: xfchf
Subject: newbie but fundamental questions
Date: 
Message-ID: <1142616197.347754.141330@i40g2000cwc.googlegroups.com>
sorry by my english, im brazillian.
all questions are about clisp implementation...

1) why (function funtion) doesnt work?
2) how is the lisp way for software distribution, is a good pratice
delivery a ".fasl" or ".lisp" file?
3) GNU EMACS its pure in lisp?
4) its possible attach a GUI in a lisp program?

thx.

From: Eric Lavigne
Subject: Re: newbie but fundamental questions
Date: 
Message-ID: <1142616962.695814.218280@j33g2000cwa.googlegroups.com>
> sorry by my english, im brazillian.
> all questions are about clisp implementation...
>
> 1) why (function funtion) doesnt work?

If that is your whole program, then it doesn't work because "function"
and "funtion" are undefined. Here is a hello world program in which
(function funtion) does work:

(defun function (x)
  (print x))

(defvar funtion "hello world")

(function funtion)

> 2) how is the lisp way for software distribution, is a good pratice
> delivery a ".fasl" or ".lisp" file?

Other Lisp programmers would prefer to get the .lisp file so they can
read your code. If you are writing code for other programmers (such as
libraries) then these are often distributed with asdf.

http://www.cl-user.net/asp/libs/ASDF

If you are writing a program that will be used by non-programmers on
Windows, they would probably prefer an .exe file. CLisp is able to
create .exe files.

> 3) GNU EMACS its pure in lisp?

Clisp is an implementation of Common Lisp. GNU EMACS uses Emacs Lisp.
These are both Lisp, but they have different features.

> 4) its possible attach a GUI in a lisp program?

Yes, there are many ways to do this. GUIs were discussed in another
thread recently on this newsgroup:

http://groups.google.com/group/comp.lang.lisp/browse_frm/thread/fc9e28f623c41106
From: Eric Lavigne
Subject: Re: newbie but fundamental questions
Date: 
Message-ID: <1142617668.803582.4690@j52g2000cwj.googlegroups.com>
> > 1) why (function funtion) doesnt work?
>
> If that is your whole program, then it doesn't work because "function"
> and "funtion" are undefined. Here is a hello world program in which
> (function funtion) does work:
>
> (defun function (x)
>   (print x))
>
> (defvar funtion "hello world")
>
> (function funtion)
>

This is wrong. I didn't notice that "function" is a special form in
Common Lisp. "function" allows you to refer to a function without
calling the function. For example:

(defun x ()
  (print "function x was called"))

(defvar x "a variable called x")

x now means two different things. It is a function and a variable.

If I call it as a function, like this:

(x)

Then it will print "function x was called"

But if I use it like an ordinary variable, then I get "a variable
called x":

(print x)

The result of the above statement is that "a variable called x" gets
printed"

Now if I want to print the function x instead...

(print (function x))

Now it will print "#<FUNCTION X>"
From: xfchf
Subject: Re: newbie but fundamental questions
Date: 
Message-ID: <1142617762.774977.273400@j33g2000cwa.googlegroups.com>
ah, sorry i try to ask:
1) why (function function) doesnt work?
: - )
thanks.
From: Eric Lavigne
Subject: Re: newbie but fundamental questions
Date: 
Message-ID: <1142618294.134955.47460@j52g2000cwj.googlegroups.com>
> ah, sorry i try to ask:
> 1) why (function function) doesnt work?
> : - )
> thanks.

This doesn't work because function expects a function as an argument.

(defun example-function ()
  (print "hello world"))

(defmacro example-macro ()
  '(print "hello world"))

This will work:

(function example-function)

This will not work:

(function example-macro)

This will not work (because function is not a function):

(function function)

Function is a "special form", rather than a function. I think "special
form" is similar to macro, and that the difference (if there is a
difference) is only important to compiler writers.
From: Pascal Bourguignon
Subject: Re: newbie but fundamental questions
Date: 
Message-ID: <87zmjoc1qk.fsf@thalassa.informatimago.com>
"xfchf" <·····@hotmail.com> writes:
> 3) GNU EMACS its pure in lisp?

Most lisp implementations are written partly in lisp, partly in
assembler (like C for example).  Generally, only a small part,
interfacing with the OS is written in assembler.  Ok, in C if you
want.


GNU emacs, which contains emacs lisp, is also written partly in emacs
lisp and party in C.

But really, what's written in C is uninteresting bits like low-level
data types, virtual machines, etc.  So we can say that indeed, emacs
lisp and the emacs editor/environment/platform is purely written in
lisp.

-- 
__Pascal Bourguignon__                     http://www.informatimago.com/

"You cannot really appreciate Dilbert unless you read it in the
original Klingon"
From: Thomas F. Burdick
Subject: Re: newbie but fundamental questions
Date: 
Message-ID: <xcvacbokq8v.fsf@conquest.OCF.Berkeley.EDU>
"xfchf" <·····@hotmail.com> writes:

> sorry by my english, im brazillian.
> all questions are about clisp implementation...
> 
> 1) why (function funtion) doesnt work?

Because there is no function named FUNCTION.  Perhaps you should say
what you expected it to do.

> 2) how is the lisp way for software distribution, is a good pratice
> delivery a ".fasl" or ".lisp" file?

To distribute the source of an open-source library or application, an
ASDF-INSTALL-compatible asdf package is the preferred method.  To
distribute a binary application, one usually distributes a lisp vm, a
core file containing your application, and a script to start it up;
some implementations allow you to combine the vm and core, or to skip
the script.

> 3) GNU EMACS its pure in lisp?

Nope, not even close.

> 4) its possible attach a GUI in a lisp program?

It's possible, and these days quite easy.  Check out Ltk:
http://www.peter-herth.de/ltk/

-- 
           /|_     .-----------------------.                        
         ,'  .\  / | Free Mumia Abu-Jamal! |
     ,--'    _,'   | Abolish the racist    |
    /       /      | death penalty!        |
   (   -.  |       `-----------------------'
   |     ) |                               
  (`-.  '--.)                              
   `. )----'