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 9123337
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T06:18:53+00:00 2026-06-17T06:18:53+00:00

I am still trying to increase my lisp reading speed. As such, my first

  • 0

I am still trying to increase my lisp reading speed. As such, my first inclination is to try and name everything (usually in let bindings) to make up for my slow comprehension. In examples online, there is always a mix of some things being bound, and others just being used in place.

Like this silly s-expression to parse (1 2 4 + 4) could be written with let bindings:

 (let [first-nums  (take (- (count args) 2) args)
       last-num (last args)
       fun (nth args (- (count args) 2))]
    (reduce fun (conj first-nums last-num))))

Or without:

  (reduce (nth args (- (count args) 2))
          (conj (take (- (count args) 2) args)
                (last args)))))

On the one hand, giving good domain names to “concepts” is something that I believe very much when working in the c-style languages, and even though the scope of let is very strictly defined, it still feels very anti-functional to be binding state.
What is your criteria for when to use bindings?

  • 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-06-17T06:18:55+00:00Added an answer on June 17, 2026 at 6:18 am

    Giving things names is fine. It helps making things self-documenting. There is nothing wrong with it. If things are too obvious one might want to get rid of it sometimes:

    (let ((number1 12)
          (number2 30))
      (+ number1 number2))
    

    Above does not add much to the expression (+ 12 30). But if you want to document domain values, then instead of

    (let ((number1 12)        ; border width
          (number2 30))       ; table width
      (+ number1 number2))
    

    better write

    (let ((table-width 30)
          (border-width 12))
       (+ table-width border-width))     
    

    One question which remains is this: when you have a data structure, you want to use parts of it in some way and you want to give these parts temporary names – how to do that?

    In your example, LET introduces the names and you provide hand-written code to extract the values.

    Slighty ‘better’ could be a more descriptive approach:

    (match-let (*args1 function arg2)                  ; a pattern
          expression                                   ; a data structure
       (reduce function (append args1 (list arg2))))   ; a body
    

    Something like the above would make sense if you have to deal with such patterns often in the code. It would make the code more declarative.

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

Sidebar

Related Questions

First off I am still new to objective-c and still trying to learn as
Still trying to figure this out from yesterday. I am trying to scroll an
I'm still trying to learn jquery so bear with me. I have a dual
I am still trying to test my WinForm application, however some of the testing
I'm still trying to get a hang of Perl's OOP features. I'm confused about
I'm still trying to get my feet on the ground with Silverlight and RIA
I'm still trying to wrap my head around how things should be done in
I am still trying to understand the themeing engine of magento by studying a
I'm still trying to get the hang of SQL. I built 1 query that
So I'm still trying to get comfortable using Parsec, but I'm slowly working it

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.