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

The Archive Base Latest Questions

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

I have a procedure with no arguments that creates a matrix, but returns nothing,

  • 0

I have a procedure with no arguments that creates a matrix, but returns nothing, how can i access the matrix?

This is my code:

(define matrix
  (lambda (rows columns)
    (do ((m (make-vector rows))
         (i 0 (+ i 1)))
        ((= i rows) m)
      (vector-set! m i (make-vector columns)))))

(define Mod-matrix!
  (lambda (m i j)
    (vector-ref (vector-ref m i) j)))

(define (board) 
  (mk-w (matrix 8 8) 0 0))

(define (mk-b b l c)
  (cond ((and (< l 8) (< c 8)) (begin
                                (Mod-matrix! b l c p)
                                (mk-b b l (+ c 2))))
        ((and (>= c 8) (< l 8))(mk-b b (+ l 2) 0))
        (else (mk-w b 0 1))))

(define (mk-b b l c)
  (cond ((and (< l 8) (< c 8)) (begin
                                (Mod-matrix! b l c b)
                                (mk-w ti l (+ c 2))))
        ((and (>= c 8) (< l 8)) (mk-white b (+ l 2) 0))))
  • 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:25:23+00:00Added an answer on May 18, 2026 at 11:25 pm

    Your mk-w function is not returning the matrix. Try the following:

    (define (mk-w b l c)
     (cond
      ((and (< l 8) (< c 8))
       (begin (Mod-matrix! b l c)
            (mk-w b l (+ c 2))
            b))
      ((and (>= c 8) (< l 8))
       (begin
        (mk-w b (+ l 2) 0)
        b))))
    

    Note that in each case the last expression in the begin block is the matrix itself, this is because the return value of a begin block is the value of the last expression. In your post, those last expressions returned an undefined value.

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

Sidebar

Related Questions

Let's say I have a procedure foo that takes three arguments, and returns a
So if a language provides higher order procedure then I can have procedure that
We have a Procedure in Oracle with a SYS_REFCURSOR output parameter that returns the
Well I have this MySQL stored procedure that I wrote and if I run
I have a search function that executes a stored procedure and returns results. If
Of late, I have a tendency to validate my stored procedure action query arguments
I receive some arguments into a stored procedure. These arguments are NVARCHAR's. I have
I have a procedure that is run for a lot of items, skipping over
I have this procedure i my package: PROCEDURE pr_export_blob( p_name IN VARCHAR2, p_blob IN
I have a stored procedure that takes a string of a pipe delimited array

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.