'exists' and 'for-all'

Notices and updates

'exists' and 'for-all'

Postby Fanda » Mon Feb 05, 2007 9:18 pm

I suggest to rename new functions:
'exists' to 'any'
and
'for-all' to 'all'

Fanda

PS: See
http://newlisp-on-noodles.org/wiki/inde ... Predicates
Fanda
 
Posts: 253
Joined: Tue Aug 02, 2005 6:40 am

Postby Lutz » Mon Feb 05, 2007 9:36 pm

In the case of 'exists' and 'for-all' I wanted to stay with the http://www.r6rs.org/r6rs-lib_92.pdf naming of these functions.

Lutz
Lutz
 
Posts: 4902
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California

Postby Jeremy Dunn » Tue Feb 06, 2007 2:39 am

I can live with "exists" although I prefer unhyphenated names when possible, especially for a function that will be used a lot. But shouldn't "for-all" at least be "for-all?" in NewLISP syntax since it returns boolean values whereas "exists" does not?
Jeremy Dunn
 
Posts: 95
Joined: Wed Oct 13, 2004 8:02 pm
Location: Bellingham WA

Postby Lutz » Tue Feb 06, 2007 3:09 am

'for-all' and 'exists' are not predicates by themselves, but rather apply a predicate to a list of expressions in a special fashion (and/or).

Lutz
Lutz
 
Posts: 4902
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California

Postby Jeremy Dunn » Tue Feb 06, 2007 8:25 pm

I'm not sure that I agree. The statement

(if (for-all ...) ...)

performs the exact same purpose as

(if (zero? x) ...)

Why is for-all not a predicate? This seems to me like arguing that "houseboat" is not a noun because it contains the noun "house" within it.
Jeremy Dunn
 
Posts: 95
Joined: Wed Oct 13, 2004 8:02 pm
Location: Bellingham WA

Postby cormullion » Tue Feb 06, 2007 9:04 pm

Lutz wrote:In the case of 'exists' and 'for-all' I wanted to stay with the http://www.r6rs.org/r6rs-lib_92.pdf naming of these functions.


Interesting. Why so? Are we moving toward Common Lisp (or Scheme)? ;-)
cormullion
 
Posts: 2014
Joined: Tue Nov 29, 2005 8:28 pm
Location: latiitude 50N longitude 3W

Postby Lutz » Tue Feb 06, 2007 9:44 pm

To Jeremy:

In formal logic you call 'for-all' and 'exists' universal or existential quantifiers binding predicates in a logical proposition. They quantify the application of a predicate making it true for either everything/for all or at least one/exists. They only work in conjunction with a predicate applying predicates with a logical connective to a list, but they are not predicates themselves.

To Cormullion:

newLISP most of the time has chosen existent wordings of functions from either Common Lisp or Scheme or earlier incarnations of LISP. This makes it easier for switchers and builds on an existing culture. But we are definitely not moving toward Common Lisp or Scheme. Also newLISP's influences are not limited to other LISPs, newLISP has also taken from other languages, i.e. 'begin' from Pascal instead of 'progn' in Common Lisp, formatting characters from 'C' etc.

Lutz
Lutz
 
Posts: 4902
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California

Postby cormullion » Tue Feb 06, 2007 10:05 pm

But we are definitely not moving toward Common Lisp or Scheme.


That's good to know. It would only slow things down... :-)))))
cormullion
 
Posts: 2014
Joined: Tue Nov 29, 2005 8:28 pm
Location: latiitude 50N longitude 3W

Postby nigelbrown » Wed Feb 07, 2007 12:09 am

Lutz wrote: i.e. 'begin' from Pascal


To allow ALGOL due precedence I always considered begin was from ALGOL (see http://en.wikipedia.org/wiki/ALGOL ).
Although I concede in ALGOL it was often BEGIN (eg http://bitsavers.org/pdf/dec/pdp10/TOPS ... _algol.pdf ) this is reflecting the upper-case only nature of many of that era's I/O devices, capitalisation was not required by the Revised Report that defined the language (e.g. http://www.masswerk.at/algol60/report.htm and http://www.sli-institute.ac.uk/~bob/Alg ... Report.pdf ).

Nigel
nigelbrown
 
Posts: 429
Joined: Tue Nov 11, 2003 2:11 am
Location: Brisbane, Australia


Return to newLISP newS

Who is online

Users browsing this forum: No registered users and 0 guests

cron