How Does Marijuana Affect Your Memory?

People who smoke pot have a reputation for being forgetful or absentminded. But what's the real science behind this?