If you're pushed for space, having a fold-out bed makes a lot of sense. Having a fold-out bed that's also a pair of bookshelves is an even better idea.
That's the core idea behind this particular IKEA hack, which takes a pair of $49 BILLY bookcases and uses them as the "wall" for a Murphy bed system. The bookcases sit on a plywood wheel system that allows them to roll out from the back, spinning around to allow access for the bed to fold down.
The only real downside here would be that the contents of the shelves would be inaccessible when the bed was down. No bedtime reading from there!
BILLY Bookcases transform into Murphy Bed [IKEAhackers]