Lists in scheme -


I am trying to write a function in the plan that takes every item list and class in the list, then returns the list As is (list xyz) . However, I'm not sure how to write a code that would do this. So far, I have

  (defined (category = list list) (cond [(empty? List) false) [and (list (SQL) (first A-list)) (Square-list) (The rest is a list)))])  

but it returns

  to the list (cons y (cons z empty))  

What can I do to return it to the list only in (list xyz) ? Thanks!

You're almost there - make sure you type cons and List (The text book explains this section 13. You can find copies online).

Conflict The first element for the 'rest' part and (usually) one (potentially empty) list as an example, (Opposition 1 blank) Number 1 as its first element and the empty list is in the form of 'rest' (Opposition 1 (Opposition 2 Empty)) No. 1 before Element, and (Opposition 2 empty) is in the form of 'rest'.

List is just a simple shorthand for creating lists, taking an arbitrary number of items as follows:

(list 1 2 3 4 5)

is the same ...

'(1 2 3 4 5)

Which Is similar

(Opposition 1 (Opposition 2 (Opposition 3 (Opposition 4 (Opposition 5 blank))))) .

But be careful (List 1 (list2 (list3)) is similar to No (Opposition 1 (Opposition 2 ( Oppose 3 is empty))) . In fact, this is (Opposition 1 (empty of Opposition 2 (Opposition 3 empty) empty)) .

If you are still confused, do not hesitate to post a comment.


Comments

Popular posts from this blog

ios - Form Sheet content disappearing -

c++ - an enclosing-function local variable cannot be referenced in a lambda body unless if it is in capture list -