Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.lisp > #32979

Re: new functions defined list

From paul wallich <pw@panix.com>
Newsgroups comp.lang.lisp
Subject Re: new functions defined list
Date 2019-05-28 14:28 -0400
Organization PANIX Public Access Internet and UNIX, NYC
Message-ID <qcjujt$ar7$1@reader2.panix.com> (permalink)
References <05ea985c-6cf6-4532-bc90-caec8c483c76@googlegroups.com> <agX5cNkPaSHiCHjuz4pOQW6J1fws4@bongo-ra.co> <ea5d4de3-5795-462a-b037-a2c6fb243bce@googlegroups.com>

Show all headers | View raw


On 5/28/19 2:12 PM, Sai Sai wrote:
> But wait a minute... supose that I (defun fact... << factorial>>) in a file "test.lisp" then  (load 'test.lisp) the function fact is in some place, because i write (fact 5) any time's and the interpreter returns =>120.
> There should be a function that return the functions loaded from a file.

As people have been trying to point out to you, it all depends on what 
you mean by new function. Let's say you load that file containing a 
definition of factorial, but you already had some other function called 
factorial that you'd defined in another file that you loaded. New 
function or just new version of old function? Ditto if you rewrite the 
factorial function at the repl. If you write a new function at the repl, 
do you want to count that, or just when loaded from files? If you just 
want to count/track new functions that you've written, you could write a 
MyDefun macro that pushes the name onto a list of functions and then 
executes the regular defun, but that wouldn't count anything in files 
you load that aren't written with that convention in mind.

The underlying question is what you want to accomplish with this.

> Obviously when I quit CLISP all my functions loaded from a file will be lost.

(Unless you save an image that contains the new version of your 
programming universe, which is possible in Clisp and other lisps.)

paul

Back to comp.lang.lisp | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

new functions defined list Sai Sai <sairussuria@gmail.com> - 2019-05-28 07:10 -0700
  Re: new functions defined list "Pascal J. Bourguignon" <pjb@informatimago.com> - 2019-05-28 19:35 +0200
    Re: new functions defined list Sai Sai <sairussuria@gmail.com> - 2019-05-28 10:45 -0700
      Re: new functions defined list Spiros Bousbouras <spibou@gmail.com> - 2019-05-28 18:00 +0000
  Re: new functions defined list Spiros Bousbouras <spibou@gmail.com> - 2019-05-28 17:50 +0000
    Re: new functions defined list Sai Sai <sairussuria@gmail.com> - 2019-05-28 11:01 -0700
    Re: new functions defined list Sai Sai <sairussuria@gmail.com> - 2019-05-28 11:12 -0700
      Re: new functions defined list "Pascal J. Bourguignon" <pjb@informatimago.com> - 2019-05-28 20:22 +0200
        Re: new functions defined list Spiros Bousbouras <spibou@gmail.com> - 2019-05-28 19:20 +0000
          Re: new functions defined list "Pascal J. Bourguignon" <pjb@informatimago.com> - 2019-05-28 21:53 +0200
            Re: new functions defined list Spiros Bousbouras <spibou@gmail.com> - 2019-05-28 20:34 +0000
          Re: new functions defined list paul wallich <pw@panix.com> - 2019-05-28 21:03 -0400
          Re: new functions defined list Kaz Kylheku <847-115-0292@kylheku.com> - 2019-05-29 17:09 +0000
            Re: new functions defined list "Pascal J. Bourguignon" <pjb@informatimago.com> - 2019-05-29 20:40 +0200
        Re: new functions defined list Madhu <enometh@meer.net> - 2019-05-29 06:43 +0530
        Re: new functions defined list rpw3@rpw3.org (Rob Warnock) - 2019-05-31 15:50 +0000
      Re: new functions defined list paul wallich <pw@panix.com> - 2019-05-28 14:28 -0400
        Re: new functions defined list Sai Sai <sairussuria@gmail.com> - 2019-05-28 11:53 -0700
      Re: new functions defined list Spiros Bousbouras <spibou@gmail.com> - 2019-05-28 19:07 +0000
      Re: new functions defined list taruss@google.com - 2019-05-28 15:10 -0700
    Re: new functions defined list smh <shaflich@gmail.com> - 2019-05-29 04:00 -0700
  Re: new functions defined list "Pascal J. Bourguignon" <pjb@informatimago.com> - 2019-05-28 20:13 +0200
  Re: new functions defined list taruss@google.com - 2019-05-29 11:46 -0700

csiph-web