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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T03:37:22+00:00 2026-05-27T03:37:22+00:00

My list grabs user input, and creates a list – this list is in

  • 0

My list grabs user input, and creates a list – this list is in characters.

I would like to be able to check if the (car myList) is a character like #\1 or #\2, and then change the car of the list into 1 or 2.

I am using DrRacket.

The problem so far has been attempting to call either (set! (car myList) 1) or (list-set! (car myList) 1 )

Both are undefined references in my environment.

I just started working with scheme today, for a university assignment.

Any help would be greatly appreciated if anyone has time

Thanks

  • 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-27T03:37:23+00:00Added an answer on May 27, 2026 at 3:37 am

    I used a stack implementation from this site:

    http://zoo.cs.yale.edu/classes/cs201/Fall_2007/materials/pdfs/stacks.pdf

    The stack let me , well i guess “mirror” my list. after i checked what symbol the user input character was, i would just push an appropriate character onto my stack.

    (define (makeListFromSymbols myList)
    
      (display "Length of List = ")
      (display(length myList)) (newline)
       (cond
    
          ((null? myList) 
           (display "LIST IS NULL")(newline)
    
           (popTheRestOfStack)
    
           )
          ((eq? #\0 (car myList)) 
           (display "Equals 0") 
           (stackForExpression 'push! #\0)
           (makeListFromSymbols(cdr myList))
           (newline)
           )
          ((eq? #\1 (car myList)) 
           (display "Equals 1") 
           (stackForExpression 'push! #\1)
           (makeListFromSymbols(cdr myList) )
           (newline)
           )
          ((eq? #\2 (car myList)) 
           (display "Equals 2") 
           (stackForExpression 'push! #\2)
           (makeListFromSymbols(cdr myList))
           (newline)
           )
          ((eq? #\3 (car myList)) 
           (display "Equals 3") 
           (stackForExpression 'push! #\3)
           (makeListFromSymbols(cdr myList))
           (newline)
           )
          ((eq? #\4 (car myList)) 
           (display "Equals 4") 
           (stackForExpression 'push! #\4)
           (makeListFromSymbols(cdr myList))
           (newline)
           )
          ((eq? #\5 (car myList)) 
           (display "Equals 5") 
           (stackForExpression 'push! #\5)
           (makeListFromSymbols(cdr myList))
           (newline)
           )
          ((eq? #\6 (car myList)) 
           (display "Equals 6") 
           (stackForExpression 'push! #\6)
           (makeListFromSymbols(cdr myList))
           (newline)
           )
          ((eq? #\7 (car myList)) 
           (display "Equals 7") 
           (stackForExpression 'push! #\7)
           (makeListFromSymbols(cdr myList))
           (newline)
           )
          ((eq? #\8 (car myList)) 
           (display "Equals 8") 
           (stackForExpression 'push! #\8)
           (makeListFromSymbols(cdr myList))
           (newline)
           )
          ((eq? #\9 (car myList)) 
           (display "Equals 9") 
           (stackForExpression 'push! #\9)
           (makeListFromSymbols(cdr myList))
           (newline)
           )
          ((eq? #\+ (car myList)) 
           (display "Equals +") 
           (handleAdditionOperator)
           (makeListFromSymbols(cdr myList))
           (newline)
           )
          ((eq? #\/ (car myList)) 
           (display "Equals /") 
           (handleDivisionOperator)
           (makeListFromSymbols(cdr myList))
           (newline)
           )
          ((eq? #\- (car myList)) 
           (display "Equals -") 
           (handleSubtractionOperator)
           (makeListFromSymbols(cdr myList))
           (newline)
           )
          ((eq? #\* (car myList)) 
           (display "Equals *") 
           (handleMultiplicationOperator)
           (makeListFromSymbols(cdr myList))
           (newline)
           )
          ((eq? #\( (car myList)) 
           (display "Equals (")
           (stack1 'push! #\( )
    
           (makeListFromSymbols(cdr myList))
           (newline)
           )
          ((eq? #\) (car myList)) 
           (display "Equals )") 
    
           (popAndTransferUntilLeftBracket) 
    
           (makeListFromSymbols(cdr myList))
           (newline)
           )
          (else (display "Character is invalid")(newline) (makeListFromSymbols(cdr myList)))
          )
    
      )
    

    if anyone ever has similar questions on this, or about my code / functions, email me. ( i think my email is shown on my user page?)

    i also have a pseudo code algorithm for conversion of infix to post fix notation (that was the assignment here)

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

Sidebar

Related Questions

I'm creating a user input where I want them to list links as well
I have a document structure in MongoDB like this: User |---> Posts |----> Comments
I've got a routine that grabs a list of all images in a directory,
List Comprehension for me seems to be like the opaque block of granite that
This is/isn't homework...the printing of the list IS homework and that works great, the
I'm having trouble manipulating JavaScript generated html elements. Depending on user input - a
How do I check for null in a array list and remove them? It
So, I have this code that grabs a bunch of data from the database,
I use from this code: List<GroupPrincipal> result = new List<GroupPrincipal>(); // establish domain context
I have written a Servlet something like this public class ServletUtil extends HttpServlet {

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.