[plt-scheme] Doubt in exercise 16.2.5

From: Matthias Felleisen (matthias at ccs.neu.edu)
Date: Tue Mar 31 09:48:21 EDT 2009

Renato, let me translate the error message:

1. 'dir-content' is a selector function from the dir teachpack and  
you are using it somewhere in your program.

2. it expects to be applied to one argument, an instance of the dir  
structure, also defined in the teachpack.

3. it is instead applied to a list, which contains an instance of a  
dir struct.

Usually drscheme also highlights the offending call to dir-content.

My conjecture is that you didn't follow the design recipe carefully  
enough and that you failed to distinguish list of directories (and  
files) from plain directories. -- Matthias

On Mar 30, 2009, at 4:32 PM, Renato Dutra Luciano wrote:

> Hi! I am Renato from Brazil
> In the exercise 16.2.5, I cannot solve the problem,
> because I don't have any idea how to work with the error messages.
> "dir-content: expects argument of type <struct:dir>; given (list  
> (make-dir 'Text (list 'part1 'part2 'part3)) (make-dir 'Libs (list  
> (make-dir 'Docs (list 'read)) (make-dir 'Codes (list 'hang 'draw)))))"
> What do you suggest?
> Thanks
> Renato.
> Veja mapas e encontre as melhores rotas para fugir do trânsito com  
> o Live Search Maps! Experimente já!
> _________________________________________________
>   For list-related administrative tasks:
>   http://list.cs.brown.edu/mailman/listinfo/plt-scheme

Posted on the users mailing list.