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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T16:27:06+00:00 2026-06-09T16:27:06+00:00

I enjoy common lisp, but sometimes it is really painful to input simple math

  • 0

I enjoy common lisp, but sometimes it is really painful to input simple math expressions like

a(8b^2+1)+4bc(4b^2+1)

(Sure I can convert this, but it is kind of slow, I write (+ () ()) first, and then in each bracket I put (* () ())…)

I’m wondering if anyone here knows a better way to input this. I was thinking about writing a math macro, where

(math “a(8b^2+1)+4bc(4b^2+1)”) 

expands to

(+ (* a (1+ (* 8 b b))) (* 4 b c (1+ (* 4 b b))))

but parsing is a problem for variables whose names are long.

Anybody has better suggestions?

  • 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-09T16:27:08+00:00Added an answer on June 9, 2026 at 4:27 pm

    There are reader macros for this purpose.

    See: http://www.cliki.net/infix

    For example:

    CL-USER 17 > '#I(a*(8*b^^2+1)+ 4*b*c*(4*b^^2+1) )
    (+ (* A (+ (* 8 (EXPT B 2)) 1)) (* 4 B C (+ (* 4 (EXPT B 2)) 1)))
    

    ' is the usual quote. #I( some-infix-expression ) is the reader macro.

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

Sidebar

Related Questions

I enjoy using recursion whenever I can, it seems like a much more natural
Ruby/Rails enjoy some really nice and powerful Behavior Driven Design/Development testing frameworks like Cucumber
I've been using LINQ for awhile (and enjoy it), but it feels like I
I am not a mathematician. I enjoy a good math puzzle, but I admit
I really enjoy to be able to do this in C# : IEnumerable GetThePizzas()
Help! I enjoy Excel but I wanted to see if this were an option.
I would like to enjoy code formatting for .json files in Zend Studio. I
I rather enjoy adding practical eye-candy to the networking community I've been developing but
I am really starting to enjoy unit testing and have the following question to
I've begun using ReSharper and really enjoy it. However I have a project which

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.