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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T02:05:24+00:00 2026-05-27T02:05:24+00:00

I started playing with Racket pattern matching system recently and got into a problem

  • 0

I started playing with Racket pattern matching system recently and got into a problem i can’t understand.

If i do:

(match (list 1 2 3 4 5 6 7 8 9 10 11 12)
    [(list _ x y z ...) (list y ': x)]) 

in REPL i get

'(3 : 2)

as my desired result.

If i do:

(match (current-date)
    [(date* _ x y z ...) (list y ': x)])

or

(match (date* 5 18 13 18 11 2011 5 321 #f 3600 0 "W. Europe Standard Time")
    [(date* _ x y z ...) (list y ': x)])

i get this error:

match: wrong number for fields for structure date*: expected 12 but got 5 in: (_ x y z ...)

i suspect that the Kleene star ... does not work with struct type for some reason. Why is it so?

  • 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-27T02:05:25+00:00Added an answer on May 27, 2026 at 2:05 am

    It seems that what you really want to do is match a subset of the fields in a struct, rather than actually bind the rest of the fields in the struct to (z …). In this case, you may want to try using the struct* match pattern instead.

    Here’s an example:

    (match (date* 5 18 13 18 11 2011 5 321 #f 3600 0 "W. Europe Standard Time")
       [(struct* date ([minute x] [hour y])) (list y ': x)])
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have recently started playing around with iOS development and have got most of
I recently just started playing around in PHP and got myself a small project/homework.
I've recently started playing with Scala (2.8) and noticed the I can write the
Recently I have started playing with jQuery, and have been following a couple of
I just started playing around with threading today and I ran into something that
I've finally started playing around with Resharper and am loving it! The only problem
I've just started playing the MVVM Light Toolkit and I'm wondering how can I
I have recently started playing around with sites and created a basic page. <apex:page
I've started playing alittle with erlang, and find it most interesting. My problem is
I've recently started playing around with ASP.NET and I was just about to connect

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.