Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
one small function
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  Messages 1 - 25 of 76 - Collapse all  -  Translate all to Translated (View all originals)   Newer >
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
ab talebi  
View profile  
 More options Feb 3 2002, 12:22 pm
Newsgroups: comp.lang.lisp
From: "ab talebi" <ab_talebi...@yahoo.com>
Date: Sun, 03 Feb 2002 17:22:22 GMT
Local: Sun, Feb 3 2002 12:22 pm
Subject: one small function
consider these functions:

(setf my-list '((titi tata) (toto) (tada)))
(defun my-eql (list)
                   (eql 'toto list))

(mapcar #'my-eql my-list)
; probobly we can use a lambda-function but I'm not sure how

this will give us (NIL T NIL) whereas I just want a 2 or NIL

NIL if we can not find any 'toto in my-list  or
2 because it's the element number 2 of my-list which is 'toto


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Nils Goesche  
View profile  
 More options Feb 3 2002, 1:01 pm
Newsgroups: comp.lang.lisp
From: Nils Goesche <car...@t-online.de>
Date: Sun, 3 Feb 2002 18:59:03 +0100
Local: Sun, Feb 3 2002 12:59 pm
Subject: Re: one small function

In article <ile78.7459$pd5.164...@news2.ulv.nextra.no>, ab talebi wrote:
> consider these functions:

> (setf my-list '((titi tata) (toto) (tada)))
> (defun my-eql (list)
>                    (eql 'toto list))

> (mapcar #'my-eql my-list)
> ; probobly we can use a lambda-function but I'm not sure how

> this will give us (NIL T NIL) whereas I just want a 2 or NIL

> NIL if we can not find any 'toto in my-list  or
> 2 because it's the element number 2 of my-list which is 'toto

How about

(1+ (position 'toto my-list :key #'car))

Regards,
--
Nils Goesche
Ask not for whom the <CONTROL-G> tolls.

PGP key ID 0xC66D6E6F


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Raymond Wiker  
View profile  
 More options Feb 3 2002, 1:09 pm
Newsgroups: comp.lang.lisp
From: Raymond Wiker <Raymond.Wi...@fast.no>
Date: 03 Feb 2002 19:09:32 +0100
Local: Sun, Feb 3 2002 1:09 pm
Subject: Re: one small function

"ab talebi" <ab_talebi...@yahoo.com> writes:
> consider these functions:

> (setf my-list '((titi tata) (toto) (tada)))
> (defun my-eql (list)
>                    (eql 'toto list))

> (mapcar #'my-eql my-list)
> ; probobly we can use a lambda-function but I'm not sure how

> this will give us (NIL T NIL) whereas I just want a 2 or NIL

> NIL if we can not find any 'toto in my-list  or
> 2 because it's the element number 2 of my-list which is 'toto

        I get (NIL NIL NIL), which is quite understandable because
'toto is not the same as '(toto).

        Try something like

(position '(toto) *my-list* :test #'equal)

or

(position 'toto *my-list* :key #'car :test #'eql)

or even

(position t (mapcar #'my-test *my-list*))

--- but the last is somewhat inelegant :-)

        All of these "solutions" require you to sort of what you're
actually trying to do - are you looking for '(toto), or 'toto as the
first element in a sublist?

--
Raymond Wiker                        Mail:  Raymond.Wi...@fast.no
Senior Software Engineer             Web:   http://www.fast.no/
Fast Search & Transfer ASA           Phone: +47 23 01 11 60
P.O. Box 1677 Vika                   Fax:   +47 35 54 87 99
NO-0120 Oslo, NORWAY                 Mob:   +47 48 01 11 60

Try FAST Search: http://alltheweb.com/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Markus Kliegl  
View profile  
 More options Feb 3 2002, 3:37 pm
Newsgroups: comp.lang.lisp
From: Markus Kliegl <markus.kli...@t-online.de>
Date: 03 Feb 2002 21:39:48 +0100
Local: Sun, Feb 3 2002 3:39 pm
Subject: Re: one small function

That doesn't take into account that position might return nil. Use something
like this instead:
(let ((pos (position 'toto my-list :key #'car)))
  (and pos (1+ pos)))

> Regards,
> --
> Nils Goesche
> Ask not for whom the <CONTROL-G> tolls.

> PGP key ID 0xC66D6E6F

--
Markus Kliegl

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
P.C.  
View profile  
 More options Feb 3 2002, 6:54 pm
Newsgroups: comp.lang.lisp
From: "P.C." <per.cor...@privat.dk>
Date: Mon, 4 Feb 2002 00:54:00 +0100
Subject: Re: one small function
Hi.

----- Oprindelig meddelelse -----
Fra: "ab talebi" <ab_talebi...@yahoo.com>
Nyhedsgrupper: comp.lang.lisp
Sendt: 3. februar 2002 18:22
Emne: one small function

 ----- Guess that's all right. and then I made setf into setq and pastet to an
Lisp evaluator , like this ;

(setq my-list '((titi tata) (toto) (tada)))
(defun my-eql (list)
                    (eql 'toto list))
(mapcar #'my-eql my-list)

Yield error function undefined, after expecting an enter with the line (mapcar
#'my-eql my-list),
I simply don't understand why you write (list) in parentets in ;
(defun my-eql (list)
                    (eql 'toto list))
Then beside the function undefined, must be the "eql" in last line.

Have a nice day.
P.C.
http://d1o115.dk.telia.net/~u139600113/td/ans1.jpg

> ; probobly we can use a lambda-function but I'm not sure how

> this will give us (NIL T NIL) whereas I just want a 2 or NIL

Eh, ------ most proberly would be T and then nil then nothing more ;))


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
P.C.  
View profile  
 More options Feb 4 2002, 3:30 am
Newsgroups: comp.lang.lisp
From: "P.C." <per.cor...@privat.dk>
Date: Mon, 4 Feb 2002 09:29:16 +0100
Local: Mon, Feb 4 2002 3:29 am
Subject: Re: one small function
Hi.

> (setq my-list '((titi tata) (toto) (tada)))
> (defun my-eql (list)
>                     (eql 'toto list))
> (mapcar #'my-eql my-list)

I don't understand the last line ; you call mapcar with a function you define ;
(defun my-eql (list)
                     (eql 'toto list))
Now this is not a function, so what I don't understand, is how you have two
parameters to mapcar, and what the _if_ you pass on a function you described
yourself, maby the trouble is, that the function you define for that, need a
parameter list with one member ; the element the function will work on down the
list.
Please clearify, as Im'e very confused, how you first define the function that
will work with mapcar.
Have a nice day.
P.C.

http://d1o115.dk.telia.net/~u139600113/td/ans1.jpg


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
ab talebi  
View profile  
 More options Feb 4 2002, 9:41 am
Newsgroups: comp.lang.lisp
From: ab_talebi...@yahoo.com (ab talebi)
Date: Mon, 04 Feb 2002 14:41:07 GMT
Local: Mon, Feb 4 2002 9:41 am
Subject: Re: one small function
On 03 Feb 2002 21:39:48 +0100, Markus Kliegl

ok, lets say that we impliment that into a function like this:

(defun find-position (word list)
  (let ((pos (position word list :key #'car)))
    (and pos (1+ pos))))

and we modify our list:

(setf my-list
'((titi tata) (toto) (titi) (toto) (tada)))

to contain several '(toto)s it will still return only the position of
the first one
2
whereas it should give us
2 4

any idea?

tnx

ab talebi


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Alexey Dejneka  
View profile  
 More options Feb 4 2002, 10:01 am
Newsgroups: comp.lang.lisp
From: Alexey Dejneka <adejn...@comail.ru>
Date: 04 Feb 2002 18:11:05 +0300
Local: Mon, Feb 4 2002 10:11 am
Subject: Re: one small function

(defun find-positions (item list &key (test #'eql) (key #'identity))
  (loop for position from 1
        and element in list
        when (funcall test item (funcall key element))
             collect position))

* (find-positions '(toto) '((titi tata) (toto) (titi) (toto) (tada)) :test #'equal)
(2 4)
* (find-positions '(toto) '((titi tata) (toto) (titi) (toto) (tada)) :test #'equal :key #'car)
NIL
* (find-positions 'toto '((titi tata) (toto) (titi) (toto) (tada)) :test #'equal :key #'car)
(2 4)
* (find-positions 'toto '((titi tata) (toto) (titi) (toto) (tada)) :key #'car)
(2 4)

--
Regards,
Alexey Dejneka


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Nils Goesche  
View profile  
 More options Feb 4 2002, 10:04 am
Newsgroups: comp.lang.lisp
From: Nils Goesche <car...@cartan.de>
Date: 4 Feb 2002 15:04:51 GMT
Local: Mon, Feb 4 2002 10:04 am
Subject: Re: one small function

Ok, how about

(defun find-position (word list)
  (loop for sub in list
        for index from 1
        when (eq word (car sub))
        collect index))

Regards,
--
Nils Goesche
"Don't ask for whom the <CTRL-G> tolls."

PGP key ID 0x42B32FC9


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Alexey Dejneka  
View profile  
 More options Feb 4 2002, 10:38 am
Newsgroups: comp.lang.lisp
From: Alexey Dejneka <adejn...@comail.ru>
Date: 04 Feb 2002 18:47:45 +0300
Local: Mon, Feb 4 2002 10:47 am
Subject: Re: one small function

How could I forgot series...

---
(require :series)

(defun find-positions (item list &key (test #'eql) (key #'identity))
  (let* ((positions (scan-range :from 1))
         (words (scan list))
         (goodp (#M(lambda (word)
                     (funcall test item (funcall key word)))
                   words)))
    (collect (choose good-p positions))))
---

--
Regards,
Alexey Dejneka


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Thomas A. Russ  
View profile  
 More options Feb 4 2002, 2:48 pm
Newsgroups: comp.lang.lisp
From: t...@sevak.isi.edu (Thomas A. Russ)
Date: 04 Feb 2002 11:09:16 -0800
Local: Mon, Feb 4 2002 2:09 pm
Subject: Re: one small function

In Common Lisp, DEFUN is used to define functions and the syntax of the
definition form is rather a bit different than for DEFINE in Scheme.

--
Thomas A. Russ,  USC/Information Sciences Institute          t...@isi.edu    


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
P.C.  
View profile  
 More options Feb 6 2002, 5:19 am
Newsgroups: comp.lang.lisp
From: "P.C." <per.cor...@privat.dk>
Date: Wed, 6 Feb 2002 11:18:51 +0100
Local: Wed, Feb 6 2002 5:18 am
Subject: Re: one small function
Hi.

"Thomas A. Russ" <t...@sevak.isi.edu> skrev i en meddelelse
news:ymivgddf4ir.fsf@sevak.isi.edu...

> In Common Lisp, DEFUN is used to define functions and the syntax of the
> definition form is rather a bit different than for DEFINE in Scheme.

Now I agrea that I don't know Sceme ; so in Sceme you can have a list
representing the symbol .
What I mean is, that this differ from Lisp, where an evaluator automaticly will
look at car list, as if that's a symbol there will be a defined function to be
evaluatet, and the remaining part of the list, will then be the parameters
described in the function description , ---- guess you se why I simply didn't
understand this ;

>(setf my-list '((titi tata) (toto) (tada))) ;

 ;------ isn't there a missing right parentets here ?------- so the defun
my-list continue with

> (defun my-eql (list)
>                    (eql 'toto list))

> (mapcar #'my-eql my-list)

While using "(list)" ;   a predefined function, as parameter, and then Mapcar a
function "#" onto a function defined, and then making Mapcar work a function "#"
on two lists ,first a function defination list and then an unballanced list with
3 lists with each one symbol ; hope you understand how I find this very
confusing ; don't sceem have same rules about ballancing parentets as Lisp ?
P.C.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
P.C.  
View profile  
 More options Feb 6 2002, 10:09 am
Newsgroups: comp.lang.lisp
From: "P.C." <per.cor...@privat.dk>
Date: Wed, 6 Feb 2002 16:08:19 +0100
Local: Wed, Feb 6 2002 10:08 am
Subject: Re: one small function
Guess the difference Sceme/Lisp are very small but important, ------- still the
doubt I had, made me think, that you was mapping within a function allready
defined, changing the function defination, I can now se, after you explained the
#'foo being _one_ symbol, that Mapcar is not working on two but one list, and
that make sense, as Im'e used to define my own one parameter functions working
recursive with mapcar , mapping down a list.
P.C.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Geoff Summerhayes  
View profile  
 More options Feb 6 2002, 10:16 am
Newsgroups: comp.lang.lisp
From: "Geoff Summerhayes" <sNuOmSrPnA...@hNoOtSmPaAiMl.com>
Date: Wed, 06 Feb 2002 15:16:04 GMT
Local: Wed, Feb 6 2002 10:16 am
Subject: Re: one small function

"P.C." <per.cor...@privat.dk> wrote in message

news:3c610338$0$89100$edfadb0f@dspool01.news.tele.dk...

> Now I agrea that I don't know Sceme ; so in Sceme you can have a list
> representing the symbol .
> What I mean is, that this differ from Lisp, where an evaluator automaticly
will
> look at car list, as if that's a symbol there will be a defined function to be
> evaluatet, and the remaining part of the list, will then be the parameters
> described in the function description , ---- guess you se why I simply didn't
> understand this ;

> >(setf my-list '((titi tata) (toto) (tada))) ;
>  ;------ isn't there a missing right parentets here ?------- so the defun

No, look again.
        A              BC         C D    D E    EBA
    1 > (setq my-list '((titi tata) (toto) (tada)))
    ((TITI TATA) (TOTO) (TADA))

> my-list continue with
> > (defun my-eql (list)
> >                    (eql 'toto list))

No, the function is seperate from my-list.

    2 > (defun my-eql (list)
          (eql '(toto) list))
    MY-EQL

    3 > (my-eql 'toto)
    T

    4 > (my-eql '(toto))
    NIL

> > (mapcar #'my-eql my-list)

> While using "(list)" ;   a predefined function, as parameter, and then Mapcar
a
> function "#" onto a function defined, and then making Mapcar work a function
"#"
> on two lists ,first a function defination list and then an unballanced list
with
> 3 lists with each one symbol ; hope you understand how I find this very
> confusing ; don't sceem have same rules about ballancing parentets as Lisp ?
> P.C.

In Lisp, a symbol may be a function name and still be a variable
AT THE SAME TIME, which gets used depends on context.

    5 > (setf list 4)
    4

    6 > list ;; context: "list" treated as variable
    4

    7 > (function list) ;; function says: No, treat "list" as a function name
    #<function LIST 200DCA7A>

    8 > (function not-a-function)
    Error: Undefined function NOT-A-FUNCTION...

#' is shorthand for (function ...)
just like ' is shorthand for (quote ...)

    9 > #'list
    #<function LIST 200DCA7A>

    10 > (list 1 2 3 4) ;; context: "list" treates as function name
    (1 2 3 4)

MAPCAR's entry in the hyperspec looks like this:
    mapcar function &rest lists+ => result-list
In other words, MAPCAR takes as arguments a function and 0 or more lists
and returns a list.

    11 > (mapcar #'my-eql my-list)
    (NIL NIL NIL)

-----------
Geoff


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Kent M Pitman  
View profile  
 More options Feb 6 2002, 11:14 am
Newsgroups: comp.lang.lisp
From: Kent M Pitman <pit...@world.std.com>
Date: Wed, 6 Feb 2002 16:13:21 GMT
Local: Wed, Feb 6 2002 11:13 am
Subject: Re: one small function

"Geoff Summerhayes" <sNuOmSrPnA...@hNoOtSmPaAiMl.com> writes:
> MAPCAR's entry in the hyperspec looks like this:
>     mapcar function &rest lists+ => result-list
> In other words, MAPCAR takes as arguments a function and 0 or more lists
> and returns a list.

>     11 > (mapcar #'my-eql my-list)
>     (NIL NIL NIL)

Actually, it's a small point, but the use of "lists+" in the ANSI CL
(and hence CLHS) notation indicates that at least one of these lists
is required.  For better or worse, you aren't allowed to do
 (mapcar #'(lambda ())).

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Geoff Summerhayes  
View profile  
 More options Feb 6 2002, 12:04 pm
Newsgroups: comp.lang.lisp
From: "Geoff Summerhayes" <sNuOmSrPnA...@hNoOtSmPaAiMl.com>
Date: Wed, 06 Feb 2002 17:04:24 GMT
Local: Wed, Feb 6 2002 12:04 pm
Subject: Re: one small function

"Kent M Pitman" <pit...@world.std.com> wrote in message
news:sfwg04efv1a.fsf@shell01.TheWorld.com...

> "Geoff Summerhayes" <sNuOmSrPnA...@hNoOtSmPaAiMl.com> writes:

> > MAPCAR's entry in the hyperspec looks like this:
> >     mapcar function &rest lists+ => result-list
> > In other words, MAPCAR takes as arguments a function and 0 or more lists
> > and returns a list.

> >     11 > (mapcar #'my-eql my-list)
> >     (NIL NIL NIL)

> Actually, it's a small point, but the use of "lists+" in the ANSI CL
> (and hence CLHS) notation indicates that at least one of these lists
> is required.  For better or worse, you aren't allowed to do
>  (mapcar #'(lambda ())).

Oops, my bad. Nice to see you back.

Geoff


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Erik Naggum  
View profile  
 More options Feb 7 2002, 3:01 am
Newsgroups: comp.lang.lisp
From: Erik Naggum <e...@naggum.net>
Date: Thu, 07 Feb 2002 08:01:23 GMT
Local: Thurs, Feb 7 2002 3:01 am
Subject: Re: one small function
* "P.C." <per.cor...@privat.dk>
| Guess the difference Sceme/Lisp are very small but important

  They are so large that someone who has been trained in Scheme has no hope
  of ever learning Common Lisp, because they _think_ the differences are
  very small despite strong evidence to the contrary, and because it is
  possible to write Scheme in Common Lisp, they will never be "offered" the
  necessary negative feedback necessary to "get it".

  I think the problem is that most people who have not been made aware of
  this fallacy at a young age have an unnerving tendency to think that they
  know something if it looks like something they know, and the less they
  _actually_ know what they think they know, the more they think something
  that looks the same to them, also _is_ the same.  In a world of physical
  objects, this is probably not such a bad idea.  The number of things you
  need to examine to determine that something is a duck is quite limited.
  This changes with man-made objects, and even more with purely man-made
  constructs like the infrastructure of a society or programming languages,
  where you have to be able to distinguish differences between _versions_
  of what is actually _marketed_ as the same,  For instance, if you plan
  according to the tax law or the Java version of a year ago, you are in
  trouble.  This leads to a reversal of an important relationship between
  identity and details: In the physical world, if you find large similar
  properties between something new and something you know, you are quite
  justified in concluding that you know what it is, but in the man-made
  world, especially that of ideas, it is more important to look carefully
  after you have discovered large-scale similarities than before.

  For man-made things and ideas in particular, the belief that what looks
  the same is the same is an anti-intellectual attitude towards one's
  knowledge and actually betrays a lack of understanding of that which is
  believeed known.  Also, since this belief is most probably not restricted
  to one particular area of knowledge, but is a result of methodological
  errors in reasoning and learning, there is no chance at all to make such
  a believer realize that he does not actually know what he believes he
  knows until he runs into a very serious problem that he cannot resolve
  well enough for comfort.  Only when programming is made into a "team"
  effort which exposes newbies to the critical review that only gurus can
  provide, and gurus themselves acknowledge that new gurus may arise worth
  listening to, can the necessary feedback loops work well enough that good
  knowledge drives out bad.  Today, we have a lot of people who are quite
  convinced of their own competence mainly because they have never been
  challenged beyond what they already know.

  The tragedy is that "looks the same, is the same" is not commutative.  If
  you learned Common Lisp well and then found Scheme, it would be nothing
  more than some old home-made toy discovered in your parent's basement --
  cute and all that, but not worth playing with for long, because all of
  the stuff you think a real programming language should have are simply
  not there.  If you learned Scheme first and then found Common Lisp, it
  would seem just like Scheme, because what you have come to think of as a
  "programming language" is basically so little that you would not even
  comprehend all the stuff in Common Lisp that is not like Scheme at all.

///
--
  In a fight against something, the fight has value, victory has none.
  In a fight for something, the fight is a loss, victory merely relief.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Kent M Pitman  
View profile  
 More options Feb 7 2002, 5:18 am
Newsgroups: comp.lang.lisp
From: Kent M Pitman <pit...@world.std.com>
Date: Thu, 7 Feb 2002 10:16:48 GMT
Local: Thurs, Feb 7 2002 5:16 am
Subject: Re: one small function

Erik Naggum <e...@naggum.net> writes:
> * "P.C." <per.cor...@privat.dk>
> | Guess the difference Sceme/Lisp are very small but important

...
>   The tragedy is that "looks the same, is the same" is not commutative.  If
>   you learned Common Lisp well and then found Scheme, it would be nothing
>   more than some old home-made toy discovered in your parent's basement --
>   cute and all that, but not worth playing with for long, because all of
>   the stuff you think a real programming language should have are simply
>   not there.  If you learned Scheme first and then found Common Lisp, it
>   would seem just like Scheme, because what you have come to think of as a
>   "programming language" is basically so little that you would not even
>   comprehend all the stuff in Common Lisp that is not like Scheme at all.

This kind of reminds me of when I was in high school and had taken
high school algebra and a little analysis and someone handed me a
calculus textbook to give me an idea of what I would learn the next
year.  I flipped through it quickly, taking an inventory of the
notation--lots of x's and y's and exponents and sigmas and stuff.  I
shrugged and handed it back.  "Yeah, I can do all this.  Looks pretty
much like what I already know except maybe for that little squiggle
[integral sign]," I remarked to the person showing me the book. "I
guess I won't learn anything much new next year," I continued with a
sigh.

Superficial similarity and overlap of notation can be quite deceiving
sometimes.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Christian Nybų  
View profile  
 More options Feb 7 2002, 12:23 pm
Newsgroups: comp.lang.lisp
From: c...@sli.uio.no (Christian Nybų)
Date: 07 Feb 2002 18:23:41 +0100
Local: Thurs, Feb 7 2002 12:23 pm
Subject: Re: one small function

Erik Naggum <e...@naggum.net> writes:
> * "P.C." <per.cor...@privat.dk>
> | Guess the difference Sceme/Lisp are very small but important

>   They are so large that someone who has been trained in Scheme has no hope
>   of ever learning Common Lisp, because they _think_ the differences are
>   very small despite strong evidence to the contrary, and because it is
>   possible to write Scheme in Common Lisp, they will never be "offered" the
>   necessary negative feedback necessary to "get it".

At my uni, taking the SICP course is a recommended preparation for
those who wish to take the CL course.  Therefore I choose, despite
your warnings, to assimilate what Scheme has to offer as a teaching
language.  Any advice on how to get through unharmed?  (OVS phrasing
optional...)
--
chr

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Xah Lee  
View profile  
 More options Feb 7 2002, 10:36 pm
Newsgroups: comp.lang.lisp
From: x...@xahlee.org (Xah Lee)
Date: 7 Feb 2002 19:36:03 -0800
Local: Thurs, Feb 7 2002 10:36 pm
Subject: Re: one small function
Here we have the Nagging Naggum, detailing his fantasy of Scheme
hatred, through cunning theories and fastidious remarks, on the
philosophies of same and not the same, the tragedies of commutative or
non-commutative phrase inventions.

"P.C." <per.cor...@privat.dk> wrote:

 > Guess the difference Sceme/Lisp are very small but important

The different is trivial, the distinction trifle. In the history of
computer languages, they are identical.

What's different languages? Logical languages and functional languages
are different. Pure OOP languages and traditional imperative languages
are different. Lisp family languages and purely functional languages
makes a huge difference. Purely functional languages and denotational
languages have importantly distinct concepts.

My readers, set your eyes afar, your views afield. Don't fret about
the trifling particularities of Scheme and common lisps that so bugs
the Nag'm & Pit-man scheming haters. If you are concerned about
learning something, master a *different* language as i outlined above.
Broaden your mind.

Btw, i think i'm the first person who coined Nagging Naggum. (is that
right, Erik?) If so, i should get some credit.

 Xah
 x...@xahlee.org
 http://xahlee.org/PageTwo_dir/more.html

--

From: Erik Naggum (e...@naggum.net)
Subject: Re: one small function
Newsgroups: comp.lang.lisp
Date: 2002-02-07 00:01:37 PST

* "P.C." <per.cor...@privat.dk>
| Guess the difference Sceme/Lisp are very small but important

  They are so large that someone who has been trained in Scheme has no
hope
  of ever learning Common Lisp, because they _think_ the differences
are
  very small despite strong evidence to the contrary, and because it
is
  possible to write Scheme in Common Lisp, they will never be
"offered" the
  necessary negative feedback necessary to "get it".

  I think the problem is that most people who have not been made aware
of
  this fallacy at a young age have an unnerving tendency to think that
they
  know something if it looks like something they know, and the less
they
  _actually_ know what they think they know, the more they think
something
  that looks the same to them, also _is_ the same.  In a world of
physical
  objects, this is probably not such a bad idea.  The number of things
you
  need to examine to determine that something is a duck is quite
limited.
  This changes with man-made objects, and even more with purely
man-made
  constructs like the infrastructure of a society or programming
languages,
  where you have to be able to distinguish differences between
_versions_
  of what is actually _marketed_ as the same,  For instance, if you
plan
  according to the tax law or the Java version of a year ago, you are
in
  trouble.  This leads to a reversal of an important relationship
between
  identity and details: In the physical world, if you find large
similar
  properties between something new and something you know, you are
quite
  justified in concluding that you know what it is, but in the
man-made
  world, especially that of ideas, it is more important to look
carefully
  after you have discovered large-scale similarities than before.

  For man-made things and ideas in particular, the belief that what
looks
  the same is the same is an anti-intellectual attitude towards one's
  knowledge and actually betrays a lack of understanding of that which
is
  believeed known.  Also, since this belief is most probably not
restricted
  to one particular area of knowledge, but is a result of
methodological
  errors in reasoning and learning, there is no chance at all to make
such
  a believer realize that he does not actually know what he believes
he
  knows until he runs into a very serious problem that he cannot
resolve
  well enough for comfort.  Only when programming is made into a
"team"
  effort which exposes newbies to the critical review that only gurus
can
  provide, and gurus themselves acknowledge that new gurus may arise
worth
  listening to, can the necessary feedback loops work well enough that
good
  knowledge drives out bad.  Today, we have a lot of people who are
quite
  convinced of their own competence mainly because they have never
been
  challenged beyond what they already know.

  The tragedy is that "looks the same, is the same" is not
commutative.  If
  you learned Common Lisp well and then found Scheme, it would be
nothing
  more than some old home-made toy discovered in your parent's
basement --
  cute and all that, but not worth playing with for long, because all
of
  the stuff you think a real programming language should have are
simply
  not there.  If you learned Scheme first and then found Common Lisp,
it
  would seem just like Scheme, because what you have come to think of
as a
  "programming language" is basically so little that you would not
even
  comprehend all the stuff in Common Lisp that is not like Scheme at
all.

///
--
  In a fight against something, the fight has value, victory has none.
  In a fight for something, the fight is a loss, victory merely relief


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Kent M Pitman  
View profile  
 More options Feb 7 2002, 11:24 pm
Newsgroups: comp.lang.lisp
From: Kent M Pitman <pit...@world.std.com>
Date: Fri, 8 Feb 2002 04:23:36 GMT
Local: Thurs, Feb 7 2002 11:23 pm
Subject: Re: one small function

x...@xahlee.org (Xah Lee) writes:
> My readers, set your eyes afar, your views afield. Don't fret about
> the trifling particularities of Scheme and common lisps that so bugs
> the Nag'm & Pit-man scheming haters. If you are concerned about
> learning something, master a *different* language as i outlined above.
> Broaden your mind.

I'll pass on responding to the first sentence here, but
(notwithstanding the fact that Xah wants to position himself as
disagreeing with me) I'll agree with the second sentence here.

To the extent that there are things presented in a Scheme course which
introduce new ideas and broaden the mind, take them in, learn, and enjoy.

The place where we differ is in the belief that every Scheme course is,
in point of fact, an exercise in mind-broadening.  I have no problem with
Scheme per se, and I have used it myself for various work-related tasks.
However, I do have considerable problem with Scheme qua religion, and I
have routinely seen people come out of a Scheme course not thinking they
have learned a new thing, but that they have UNlearned an old thing, and,
more to the point, have often specifically learned to hate CL.  It is
routine to find that people taking Scheme courses have learned that
"iteration is Bad and tail recursion is Good", which I believe is itself
limiting and therefore bad; I have no problem if they have gotten instead
the lesson that "iteration can take on multiple syntactic forms", "there
are equivalences between conventional loops and tail recursions", "sometimes
seeing things in a different syntactic form, whether conventional or
recursive, reveals through that form truths that are not as perspicuous
in the other form".  To the extent that people instead believe that grand
truths only leap out of tail recursive form and do not leap out of the other
form, they have been misled.

Broadening the mind, that is, learning new ways to see and use things
is good.  Revamping the mind according to propaganda is not, however,
broadening the mind.

> Btw, i think i'm the first person who coined Nagging Naggum. (is that
> right, Erik?) If so, i should get some credit.

If you are able to make your own coinage, I'm not sure why you need to
operate on credit.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Rahul Jain  
View profile  
 More options Feb 7 2002, 11:50 pm
Newsgroups: comp.lang.lisp
From: Rahul Jain <rj...@sid-1129.sid.rice.edu>
Date: 07 Feb 2002 22:49:46 -0600
Local: Thurs, Feb 7 2002 11:49 pm
Subject: Re: one small function

c...@sli.uio.no (Christian Nybų) writes:
> At my uni, taking the SICP course is a recommended preparation for
> those who wish to take the CL course.  Therefore I choose, despite
> your warnings, to assimilate what Scheme has to offer as a teaching
> language.  Any advice on how to get through unharmed?  (OVS phrasing
> optional...)

You should forget that Scheme exists when you learn Lisp. Essentially,
approach Lisp with no preconcieved notions, and beware of specific
biases towards specific programming styles that your professor may
have. Lisp is designed to allow for all styles of programming, which
also means that it allows for exclusively one style if the programmer
so desires. I find it much more freeing to allow oneself to mix all
styles of programming in the same code. Object oriented, applicative,
logic, symbolic; whatever combination fits the needs of the algorithm.

--
-> -/-                       - Rahul Jain -                       -\- <-
-> -\- http://linux.rice.edu/~rahul -=-  mailto:rj...@techie.com  -/- <-
-> -/- "I never could get the hang of Thursdays." - HHGTTG by DNA -\- <-
|--|--------|--------------|----|-------------|------|---------|-----|-|
   Version 11.423.999.221020101.23.50110101.042
   (c)1996-2002, All rights reserved. Disclaimer available upon request.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Craig Brozefsky  
View profile  
 More options Feb 8 2002, 12:45 am
Newsgroups: comp.lang.lisp
From: Craig Brozefsky <cr...@red-bean.com>
Date: Fri, 08 Feb 2002 05:44:30 GMT
Local: Fri, Feb 8 2002 12:44 am
Subject: Re: one small function
Kent M Pitman <pit...@world.std.com> writes:

> > Btw, i think i'm the first person who coined Nagging Naggum. (is that
> > right, Erik?) If so, i should get some credit.

> If you are able to make your own coinage, I'm not sure why you need to
> operate on credit.

Fatality, Kent wins.

--
Craig Brozefsky                           <cr...@red-bean.com>
                                http://www.red-bean.com/~craig
Ask me about Common Lisp Enterprise Eggplants at Red Bean!


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dorai Sitaram  
View profile  
 More options Feb 8 2002, 10:27 am
Newsgroups: comp.lang.lisp
From: d...@goldshoe.gte.com (Dorai Sitaram)
Date: 8 Feb 2002 15:26:48 GMT
Local: Fri, Feb 8 2002 10:26 am
Subject: Re: one small function
In article <sikheotqk82....@ulrik.uio.no>,

Christian Nybų <c...@sli.uio.no> wrote:

>At my uni, taking the SICP course is a recommended preparation for
>those who wish to take the CL course.  Therefore I choose, despite
>your warnings, to assimilate what Scheme has to offer as a teaching
>language.  Any advice on how to get through unharmed?  (OVS phrasing
>optional...)

I would say that (in general) it is fairly difficult
for Scheme learners to learn Common Lisp.  You can kind
of get by, but you have to be resigned to that fact.
Common Lisp is the archetypal jealous-god type of
programming language.  Scheme tends to be a lot more
freewheeling, and its programs suffer less crosstalk
from their writer's acquaintance with other languages
(including CL).  From the CL point of view,
crosstalk from Scheme can be immobilizing.

What's "OVS phrasing"?

--d


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Christian Nybų  
View profile  
 More options Feb 8 2002, 1:23 pm
Newsgroups: comp.lang.lisp
From: c...@sli.uio.no (Christian Nybų)
Date: 08 Feb 2002 19:23:32 +0100
Local: Fri, Feb 8 2002 1:23 pm
Subject: Re: one small function

d...@goldshoe.gte.com (Dorai Sitaram) writes:
> What's "OVS phrasing"?

Object Verb Subject, Yoda's manner of sentence phrasing.
--
chr

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Messages 1 - 25 of 76   Newer >
« Back to Discussions « Newer topic     Older topic »