Advertisement
JF_Jaramillo

3

Sep 26th, 2020
1,968
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scheme 0.82 KB | None | 0 0
  1. (define (cargar-datos ubicacion)
  2.   (local
  3.     (
  4.      (define (cargarEmpleados listaEmpleados)
  5.        (cond
  6.          [(empty? listaEmpleados) empty]
  7.          [(not (cons? listaEmpleados)) "Porfavor cargue una lista"]
  8.          [(cons? (first listaEmpleados))
  9.           (cons (make-empleado
  10.                  (make-datos-persona (first (first listaEmpleados)) (second (first listaEmpleados)) (third (first listaEmpleados)) )
  11.                  (string->number (fourth (first listaEmpleados)))
  12.                  ) (cargarEmpleados (rest listaEmpleados))
  13.                    )]
  14.          [else (error "Error al cargar los empleados. Por favor intente de nuevo.")]
  15.          ))
  16.      (define listaEmpleados empty)
  17.      )
  18.     (cargarEmpleados (read-words/line ubicacion))
  19.   ))
  20.  
  21. (define listaEmpleados (cargar-datos "Data/Empleados.txt"))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement