* primitive-load returning result of last evaluation? @ 2002-04-09 10:36 Andreas Rottmann 2002-04-22 7:54 ` Thien-Thi Nguyen 0 siblings, 1 reply; 8+ messages in thread From: Andreas Rottmann @ 2002-04-09 10:36 UTC (permalink / raw) Hi! I wonder if it were possible to provide a primitive-load that returns the result of the last expression evaluated. It would require just a few-line-change in libguile/load.c and I guess it wouldn't break too much since primitive-load returns SCM_UNSPECIFIED right now and one can assume its return value isn't used (yet). Regards, Andy -- Andreas Rottmann | Dru@ICQ | 118634484@ICQ | a.rottmann@gmx.at http://www.8ung.at/rotty | GnuPG Key: http://www.8ung.at/rotty/gpg.asc Fingerprint | DFB4 4EB4 78A4 5EEE 6219 F228 F92F CFC5 01FD 5B62 _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://mail.gnu.org/mailman/listinfo/guile-devel ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: primitive-load returning result of last evaluation? 2002-04-09 10:36 primitive-load returning result of last evaluation? Andreas Rottmann @ 2002-04-22 7:54 ` Thien-Thi Nguyen 2002-04-22 13:05 ` Rob Browning 0 siblings, 1 reply; 8+ messages in thread From: Thien-Thi Nguyen @ 2002-04-22 7:54 UTC (permalink / raw) Cc: guile-devel From: Andreas Rottmann <a.rottmann@gmx.at> Date: 09 Apr 2002 12:36:35 +0200 I wonder if it were possible to provide a primitive-load that returns the result of the last expression evaluated. It would require just a few-line-change in libguile/load.c and I guess it wouldn't break too much since primitive-load returns SCM_UNSPECIFIED right now and one can assume its return value isn't used (yet). i think this is a reasonable change, but perhaps there is a good reason this hasn't been done since return value was fixed in 1996-09 (libguile/load.c 1.4). thi _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://mail.gnu.org/mailman/listinfo/guile-devel ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: primitive-load returning result of last evaluation? 2002-04-22 7:54 ` Thien-Thi Nguyen @ 2002-04-22 13:05 ` Rob Browning 2002-04-22 21:27 ` Dirk Herrmann 2002-04-28 15:19 ` Marius Vollmer 0 siblings, 2 replies; 8+ messages in thread From: Rob Browning @ 2002-04-22 13:05 UTC (permalink / raw) Cc: a.rottmann, guile-devel Thien-Thi Nguyen <ttn@giblet.glug.org> writes: > i think this is a reasonable change, but perhaps there is a good > reason this hasn't been done since return value was fixed in 1996-09 > (libguile/load.c 1.4). I'd be hesitant to change this too until we've had a chance to consider the issue carefully. I can't think of anything offhand that would make this a bad idea, but it's not functionality we could easily rescind once we provide it, and I have this nagging feeling there might be some problem I'm not thinking of... -- Rob Browning rlb @defaultvalue.org, @linuxdevel.com, and @debian.org Previously @cs.utexas.edu GPG=1C58 8B2C FB5E 3F64 EA5C 64AE 78FE E5FE F0CB A0AD _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://mail.gnu.org/mailman/listinfo/guile-devel ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: primitive-load returning result of last evaluation? 2002-04-22 13:05 ` Rob Browning @ 2002-04-22 21:27 ` Dirk Herrmann 2002-04-22 21:32 ` Rob Browning 2002-04-28 15:19 ` Marius Vollmer 1 sibling, 1 reply; 8+ messages in thread From: Dirk Herrmann @ 2002-04-22 21:27 UTC (permalink / raw) Cc: ttn, a.rottmann, guile-devel On Mon, 22 Apr 2002, Rob Browning wrote: > Thien-Thi Nguyen <ttn@giblet.glug.org> writes: > > > i think this is a reasonable change, but perhaps there is a good > > reason this hasn't been done since return value was fixed in 1996-09 > > (libguile/load.c 1.4). > > I'd be hesitant to change this too until we've had a chance to > consider the issue carefully. I can't think of anything offhand that > would make this a bad idea, but it's not functionality we could easily > rescind once we provide it, and I have this nagging feeling there > might be some problem I'm not thinking of... I can't think of any problems, except that the standard 'load itself does not provide a return value. And, implementing a load* that returns a value is quite simple. However, in order to spare people some work (I once also needed such a load function), we should provide it, but, I'd rather go for a standard implementation and provide such extensions as optional packages. Best regards Dirk Herrmann _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://mail.gnu.org/mailman/listinfo/guile-devel ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: primitive-load returning result of last evaluation? 2002-04-22 21:27 ` Dirk Herrmann @ 2002-04-22 21:32 ` Rob Browning 2002-04-22 21:48 ` Dirk Herrmann 0 siblings, 1 reply; 8+ messages in thread From: Rob Browning @ 2002-04-22 21:32 UTC (permalink / raw) Cc: ttn, a.rottmann, guile-devel Dirk Herrmann <dirk@ida.ing.tu-bs.de> writes: > I can't think of any problems, except that the standard 'load itself > does not provide a return value. And, implementing a load* that > returns a value is quite simple. However, in order to spare people > some work (I once also needed such a load function), we should > provide it, but, I'd rather go for a standard implementation and > provide such extensions as optional packages. So you'd like to see a separate function providing this feature i.e. load-with-result and primitive-load-with-result (or whatever)? -- Rob Browning rlb @defaultvalue.org, @linuxdevel.com, and @debian.org Previously @cs.utexas.edu GPG=1C58 8B2C FB5E 3F64 EA5C 64AE 78FE E5FE F0CB A0AD _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://mail.gnu.org/mailman/listinfo/guile-devel ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: primitive-load returning result of last evaluation? 2002-04-22 21:32 ` Rob Browning @ 2002-04-22 21:48 ` Dirk Herrmann 2002-04-22 23:09 ` Rob Browning 0 siblings, 1 reply; 8+ messages in thread From: Dirk Herrmann @ 2002-04-22 21:48 UTC (permalink / raw) Cc: ttn, a.rottmann, guile-devel On Mon, 22 Apr 2002, Rob Browning wrote: > Dirk Herrmann <dirk@ida.ing.tu-bs.de> writes: > > > I can't think of any problems, except that the standard 'load itself > > does not provide a return value. And, implementing a load* that > > returns a value is quite simple. However, in order to spare people > > some work (I once also needed such a load function), we should > > provide it, but, I'd rather go for a standard implementation and > > provide such extensions as optional packages. > > So you'd like to see a separate function providing this feature > i.e. load-with-result and primitive-load-with-result (or whatever)? Yes, in a loadable module. We could also make it the default and provide the pure standard versions as an extension. Both is possible. Which way we go depends on how people prefer to use guile: 1) Code in RnRS scheme most of the time, being aware of using extensions, or 2) Code in guile-extended scheme most of the time, only from time to time caring about portability. Personally, I prefer to have my code as portable as possible, but others may think differently. It's not worth to fight about it, but we should think about which way we would like to go. If we go for guile-extended scheme, we should, however, have an easy way to start guile in an as-strict-as-possible RnRS mode. IMO, the best solution would be a minimum RnRS guile, including only functionality for loading modules. Even optional RnRS features should be loaded on demand. This way, so I hope, we could make guile's default size very small, much smaller than today. Best regards Dirk Herrmann _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://mail.gnu.org/mailman/listinfo/guile-devel ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: primitive-load returning result of last evaluation? 2002-04-22 21:48 ` Dirk Herrmann @ 2002-04-22 23:09 ` Rob Browning 0 siblings, 0 replies; 8+ messages in thread From: Rob Browning @ 2002-04-22 23:09 UTC (permalink / raw) Cc: ttn, a.rottmann, guile-devel Dirk Herrmann <dirk@ida.ing.tu-bs.de> writes: > IMO, the best solution would be a minimum RnRS guile, including only > functionality for loading modules. Even optional RnRS features > should be loaded on demand. This way, so I hope, we could make > guile's default size very small, much smaller than today. FWIW I agree. I think I'd probably rather see separately named functions for things like "load returning value" than a redefinition of the functions when you load a module. -- Rob Browning rlb @defaultvalue.org, @linuxdevel.com, and @debian.org Previously @cs.utexas.edu GPG=1C58 8B2C FB5E 3F64 EA5C 64AE 78FE E5FE F0CB A0AD _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://mail.gnu.org/mailman/listinfo/guile-devel ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: primitive-load returning result of last evaluation? 2002-04-22 13:05 ` Rob Browning 2002-04-22 21:27 ` Dirk Herrmann @ 2002-04-28 15:19 ` Marius Vollmer 1 sibling, 0 replies; 8+ messages in thread From: Marius Vollmer @ 2002-04-28 15:19 UTC (permalink / raw) Cc: ttn, a.rottmann, guile-devel Rob Browning <rlb@defaultvalue.org> writes: > Thien-Thi Nguyen <ttn@giblet.glug.org> writes: > > > i think this is a reasonable change, but perhaps there is a good > > reason this hasn't been done since return value was fixed in 1996-09 > > (libguile/load.c 1.4). > > I'd be hesitant to change this too until we've had a chance to > consider the issue carefully. Yes. Before we make this change, we should have a way to put Guile into a R5RS mode (maybe plus selected SRFIs). The R5RS 'load' would return #<unspecified>, while the normal Guile 'load' might return the value of the last form, and take all kinds of additional arguments, etc. _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://mail.gnu.org/mailman/listinfo/guile-devel ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2002-04-28 15:19 UTC | newest] Thread overview: 8+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2002-04-09 10:36 primitive-load returning result of last evaluation? Andreas Rottmann 2002-04-22 7:54 ` Thien-Thi Nguyen 2002-04-22 13:05 ` Rob Browning 2002-04-22 21:27 ` Dirk Herrmann 2002-04-22 21:32 ` Rob Browning 2002-04-22 21:48 ` Dirk Herrmann 2002-04-22 23:09 ` Rob Browning 2002-04-28 15:19 ` Marius Vollmer
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).