Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3623020
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T23:19:53+00:00 2026-05-18T23:19:53+00:00

I’m starting to learn Lisp with a Java background. In SICP’s exercise there are

  • 0

I’m starting to learn Lisp with a Java background. In SICP’s exercise there are many tasks where students should create abstract functions with many parameters, like

 (define (filtered-accumulate combiner null-value term a next b filter)...)

in exercise 1.33. In Java (language with safe, static typing discipline) – a method with more than 4 arguments usually smells, but in Lisp/Scheme it doesn’t, does it? I’m wondering how many arguments do you use in your functions? If you use it in production, do you make as many layers?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T23:19:54+00:00Added an answer on May 18, 2026 at 11:19 pm

    SICP uses a subset of Scheme

    SICP is a book used in introductory computer science course. While it explains some advanced concepts, it uses a very tiny language, a subset of the Scheme language and a sub-subset of any real world Scheme or Lisp a typical implementation provides. Students using SICP are supposed to start with a simple and easy to learn language. From there they learn to implement more complex language additions.

    Only positional parameters are being used in plain educational Scheme

    There are for example no macros developed in SICP. Add that standard Scheme does have only positional parameters for functions.

    Lisp and Scheme offer also more expressive argument lists

    In ‘real’ Lisp or Scheme one can use one or more of the following:

    • objects or records/structures (poor man’s closures) which group things. An object passed can contain several data items, which otherwise would need to be passed ‘spread’.

    • defaults for optional variables. Thus we need only to pass those that we want to have a certain non-default value

    • optional and named arguments. This allows flexible argument lists which are much more descriptive.

    • computed arguments. The value or the default value of arguments can be computed based on other arguments

    Above leads to more complicated to write function interfaces, but which are often easier to use.

    In Lisp it is good style to have descriptive names for arguments and also provide online documentation for the interface. The development environment will display information about the interface of a function, so this information is typically only a keystroke away or is even display automatically.

    It’s also good style for any non-trivial interface which is supposed to be used interactively by the user/developer to check its arguments at runtime.

    Example for a complex, but readable argument list

    When there are more arguments, then Common Lisp provides named arguments, which can appear in any order after the normal argument. Named arguments provide also defaults and can be omitted:

    (defun order-product (product
                          &key
                          buyer
                          seller
                          (vat   (local-vat seller))
                          (price (best-price product))
                          amount
                          free-delivery-p)
      "The function ORDER-PRODUCT ..."   ; documentation string
      (declare (type ratio vat price)    ; type declarations
               (type (integer 0) amount)
               (type boolean free-delivery-p))
      ...)
    

    We would use it then:

    (order-product 'sicp
                   :seller 'mit-press
                   :buyer  'stan-kurilin
                   :amount  1)
    

    Above uses the seller argument before the buyerargument. It also omits various arguments, some of which have their values computed.

    Now we can ask whether such extensive arguments are good or bad. The arguments for them:

    • the function call gets more descriptive
    • functions have standard mechanisms to attach documentation
    • functions can be asked for their parameter lists
    • type declarations are possible -> thus types don’t need to be written as comments
    • many parameters can have sensible default values and don’t need to be mentioned

    Several Scheme implementations have adopted similar argument lists.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
Basically, what I'm trying to create is a page of div tags, each has
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I know there's a lot of other questions out there that deal with this
I have thousands of HTML files to process using Groovy/Java and I need to
I'm trying to create an if statement in PHP that prevents a single post
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
That's pretty much it. I'm using Nokogiri to scrape a web page what has

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.