CoolInterview.com - World's Largest Collection of Interview Questions & Answers, FAQs, queries, sample papers, exam papers, dumps, what, why, how, where, when questions
Interview Success Kit - Get Success in Job Interviews Interview Success Kit - 30,000 Interview Que. & Ans.
Covers 30,000+ Interview Questions asked in actual MNC Interviews - all with model answers.
Get Your Dream Job Now - www.vyoms.com
Sponsored Links
Interview Questions
Our Services

INTERVIEW QUESTIONS PROGRAMMING LANGUAGES LISP PROGRAMMING DETAILS
Question :
What is the difference between Scheme and Common Lisp?
Category Lisp Programming Interview Questions
Rating (3.0) By 20 users
Added on 5/15/2014
Views 229
Rate it!
Answers:

Scheme is a dialect of Lisp that stresses conceptual elegance and
simplicity. It is specified in R4RS and IEEE standard P1178. (See
the Scheme FAQ for details on standards for Scheme.) Scheme is much
smaller than Common Lisp; the specification is about 50 pages,
compared to Common Lisp's 1300 page draft standard. (See question
[4-10] for details on standards for Common Lisp.) Advocates of Scheme
often find it amusing that the Scheme standard is shorter than the
index to CLtL2.

Scheme is often used in computer science curricula and programming
language research, due to its ability to represent many programming
abstractions with its simple primitives. Common Lisp is often used for
real world programming because of its large library of utility
functions, a standard object-oriented programming facility (CLOS), and
a sophisticated condition handling system.

See the Scheme FAQ for information about object-oriented programming
in Scheme.

In Common Lisp, a simple program would look something like the
following:

(defun fact (n)
(if (< n 2)
1
(* n (fact (1- n)))))

In Scheme, the equivalent program would like like this:

(define fact
(lambda (n)
(if (< n 2)
1
(* n (fact (- n 1))))))

Experienced Lisp programmers might write this program as follows in order
to allow it to run in constant space:

(defun fact (n)
(labels ((tail-recursive-fact (counter accumulator)
(if (> counter n)
accumulator
(tail-recursive-fact (1+ counter)
(* counter accumulator)))))
(tail-recursive-fact 1 1)))

Whereas in Scheme the same computation could be written as follows:

(define fact
(lambda (n)
(letrec ((tail-recursive-fact
(lambda (counter accumulator)
(if (> counter n)
accumulator
(tail-recursive-fact (+ counter 1)
(* counter accumulator))))))
(tail-recursive-fact 1 1))))

or perhaps (using IEEE named LETs):

(define fact
(lambda (n)
(let loop ((counter n)
(accumulator 1))
(if (< counter 2)
accumulator
(loop (- counter 1)
(* accumulator counter))))))

Some Schemes allow one to use the syntax (define (fact n) ...) instead
of (define fact (lambda (n) ...)).



If you have the better answer, then send it to us. We will display your answer after the approval.
Rules to Post Answers in CoolInterview.com:-

  • There should not be any Spelling Mistakes.
  • There should not be any Gramatical Errors.
  • Answers must not contain any bad words.
  • Answers should not be the repeat of same answer, already approved.
  • Answer should be complete in itself.
  • Name :*
    Email Id :*
    Answer :*
    Verification Code Code Image - Please contact webmaster if you have problems seeing this image code Not readable? Load New Code
    Process Verification Enter the above shown code: *
    Inform me about updated answers to this question

    Related Questions
    View Answer
    What is the purpose of this newsgroup?
    View Answer
    How complex can I get?
    View Answer
    What if I get interrupted?
    View Answer
    How do I tell LG3 what I what?
    View Answer
    What is the ouput like?
    View Answer
    Can I save my programs to files?
    View Answer
    Why use LISP?
    View Answer

    Please Note: We keep on updating better answers to this site. In case you are looking for Jobs, Pls Click Here Vyoms.com - Best Freshers & Experienced Jobs Website.

    View ALL Lisp Programming Interview Questions & Answers

    User Options
    Latest 20 Questions
    List some hosting providers supporting Dotclear?
    Give the list of Plugin-specific parameters with description?
    What is DC_TPL_CACHE parameter?
    Explain parameter DC_PLUGINS_ROOT?
    Explain parameter DC_SESSION_NAME?
    Explain parameter DC_ADMIN_URL and DC_ADMIN_MAILFROM?
    Explain parameter DC_MASTER_KEY?
    Explain the parameters used for Database settings in DotClear?
    What is config.php?
    How many ways are there to install Dotclear?
    What are the prerequisites for installing Dotclear?
    What are the actions you must take before upgrading dotclear?
    Give the meaning of the term debt- equity(D:E) ratio.
    What do you mean by financial risk?
    What is business risk?
    State the differences between operating and financial leverage.
    What is combined leverage?
    What is operating leverage?
    What is financial leverage?
    Name the types of leverages.



    Fresher Jobs | Experienced Jobs | Government Jobs | Walkin Jobs | Company Profiles | Interview Questions | Placement Papers | Companies In India | Consultants In India | Colleges In India | Exams In India | Latest Results | Notifications In India | Call Centers In India | Training Institutes In India | Job Communities In India | Courses In India | Jobs by Keyskills | Jobs by Functional Areas

    Testing Articles | Testing Books | Testing Certifications | Testing FAQs | Testing Downloads | Testing Interview Questions | Testing Jobs | Testing Training Institutes

    Gate Articles | Gate Books | Gate Colleges | Gate Downloads | Gate Faqs | Gate Jobs | Gate News | Gate Sample Papers | Gate Training Institutes

    MBA Articles | MBA Books | MBA Case Studies | MBA Business Schools | MBA Current Affairs | MBA Downloads | MBA Events | MBA Notifications | MBA FAQs | MBA Jobs
    MBA Job Consultants | MBA News | MBA Results | MBA Courses | MBA Sample Papers | MBA Interview Questions | MBA Training Institutes

    GRE Articles | GRE Books | GRE Colleges | GRE Downloads | GRE Events | GRE FAQs | GRE News | GRE Training Institutes | GRE Sample Papers

    IAS Articles | IAS Books | IAS Current Affairs | IAS Downloads | IAS Events | IAS FAQs | IAS News | IAS Notifications | IAS UPSC Jobs | IAS Previous Question Papers
    IAS Results | IAS Sample Papers | IAS Interview Questions | IAS Training Institutes | IAS Toppers Interview

    SAP Articles | SAP Books | SAP Certifications | SAP Companies | SAP Study Materials | SAP Events | SAP FAQs | SAP Jobs | SAP Job Consultants
    SAP Links | SAP News | SAP Sample Papers | SAP Interview Questions | SAP Training Institutes |




    Copyright ©2003-2016 CoolInterview.com, All Rights Reserved.
    Privacy Policy | Terms and Conditions



    Cache = 0 Seconds