Re: LISP code example matching an abstract construct



"Juan R." <juanrgonzaleza@xxxxxxxxxxxxxxxxxxxx> writes:

Sorry if this question sound a bit strange or off-topic.

I use notation (operator argument) --> result

e.g. (SQR 2) --> 1.4142...

I would know if anyone used both next -with A and B generic simbols-

(A B) --> C

(B A) --> D

in a LISP-Scheme program.

Of course. I can't see what you'll learn from it.
Are you here to learn how to program in Lisp?



In Common Lisp:

(defun a (x) 'c)
(defun b (x) 'd)
(defvar a 1)
(defvar b 2)

LISP> (a b)
C
LISP> (b a)
D




In Scheme:

This is Pseudoscheme 2.12.

scheme[164]> (define (a x) 'c)
a defined.
scheme[165]> (define (b x) 'd)
b defined.
scheme[166]> (a b)
c
scheme[167]> (b a)
d
scheme[168]>

--
__Pascal Bourguignon__ http://www.informatimago.com/
Litter box not here.
You must have moved it again.
I'll poop in the sink.
.



Relevant Pages

  • Re: How to create local state for functions?
    ... bound to the variable new-node. ... In Lisp, DEFUN is a macro which creates the lambda closure internally ... The DEFVAR construct ensures once-only initialization. ...
    (comp.lang.lisp)
  • Re: conciseness is power
    ... > (defun find-anagrams (path) ... > (anagram-list anagrams))) ... the Perl code seems more concise. ... The Common Lisp language doesn't have this operator. ...
    (comp.lang.lisp)
  • Re: Looking for bored Lisper with GUI chops.
    ... > Common Lisp and I have this other project I'm trying to finish at the ... > Groovy gets some wins, in this app anyway, from having access to Java ... using Lispworks and Foil, my successor to jfli. ... (defun find-child (node name) ...
    (comp.lang.lisp)
  • Re: Newbie Macro Question
    ... something-else) (simple-rotatef foo bar). ... bar exist without a defvar. ... But in order for Lisp to understand what a name such as X "means" we have to associate the name with a variable. ... A binding connects a name with some storage in memory. ...
    (comp.lang.lisp)
  • Re: Naive question about lisp web applications
    ... I learned lisp almost 20 years ago, ... You just need to know a few HTML. ... (defun formular-page () ... (defun argument (name query) ...
    (comp.lang.lisp)