PasteRack.org
Paste # 19361
2025-05-07 19:32:14

Fork as a new paste.

Paste viewed 801 times.


Embed:

  1. #lang racket
  2.  
  3. (define (elevar-al-cuadrado x)
  4.   (* x x))
  5.  
  6. (define (cuadrados lst)
  7.   (cond
  8.     [(lst) (cons (elevar-al-cuadrado (car lst)) (cuadrados (cdr lst)))]
  9.     [else '()]))
  10.  
  11. ;; Prueba:
  12. (cuadrados (list 1 2 3 4))
  13. ;; Resultado esperado: '(1 4 9 16)

=>

application: not a procedure;

 expected a procedure that can be applied to arguments

  given: '(1 2 3 4)