[plt-scheme] Re: My Scheme Probelm (fwd)

From: Matt Jadud (mcj4 at kent.ac.uk)
Date: Wed Nov 15 13:06:28 EST 2006

Hi HZBilal,

I really think you should, if you can spare the time (it will pay off 
immensely), stop trying to work on the code you're working on and 
instead take a few days to work through How To Design Programs 
(http://www.htdp.org/).

To answer your specific question, you could, in the Interactions window 
in DrScheme, try things like:

 > (and #t #t)
#t
 > (and #t #f)
#f
 > (or #t #f)
#t
 > (or #f #f #f #t #f)
#t

and so on. However, the best thing you can do, assuming you don't have 
serious mastery over Scheme, is to develop some. The best way I know to 
do that is to work through some simpler exercises to get a feel for how 
to define data structures, functions that operate over those structures, 
and generally get a feel for how the language is used and written.

If you take that approach, you'll find that the questions you're asking 
will be much easier for people on this list to answer, and then you can 
start looking at applying what you're learning to your specific 
question/programming problem. That, and you'll be much more productive 
on the problem if you're confident with the basics of the language, 
which it seems like you're struggling with.

Hope that helps,
Matt

Danny Yoo wrote:
> Hi HZBilal,
> 
> Please don't email me directly; I may not necessarily have the time to 
> help you, or I may not be the best person to help you.  See:
> 
>     http://catb.org/esr/faqs/smart-questions.html#noprivate
> 
> for reasons why asking for help in private email is counterproductive 
> compared to asking a forum.  I am forwarding your question to the 
> plt-scheme mailing list so you can get appropriate help.
> 
> 
> ---------- Forwarded message ----------
> Date: Wed, 15 Nov 2006 15:43:11 -0000
> From: HZBilal <hzbilal at gmail.com>
> To: Danny Yoo <dyoo at hkn.eecs.berkeley.edu>
> Subject: Re: My Scheme Probelm
> 
> Re: [plt-scheme] My Scheme ProbelmDear Danny,
> 
> Is it possible some how to use AND and OR with Scheme, or something 
> similar to that? I.e. for example my code wants to check using an IF 
> statement if its red OR black then do this ELSE do that? So looking at 
> my sample code below, instead of repeating the code for both formals-in 
> and formals-out, it would be good if i can make it check for either then 
> pick up otherwise ignore. However, if it is not possible, then how can 
> you do this, whether with IF statements or any other conditions? 
> (pdg-vertex-set-traverse (pdg-formals-in pdg) ;; Looking through each 
> PDG for input parameters.
> 
> (lambda(v)
> 
> (abs-loc-set-traverse (pdg-vertex-ids-decl-uses v) ;; Looking through 
> vertices to check if its the right type.
> 
> (lambda(w)
> 
> (display (abs-loc-name w) out-port)
> 
> (newline out-port)
> 
> #t))#t))
> 
> (pdg-vertex-set-traverse (pdg-formals-out pdg) ;; Looking through each 
> PDG for output parameters.
> 
> (lambda(v)
> 
> (abs-loc-set-traverse (pdg-vertex-ids-decl-uses v) ;; Looking through 
> vertices to check if its the right type.
> 
> (lambda(w)
> 
> (display (abs-loc-name w) out-port)
> 
> (newline out-port)
> 
> #t))#t))
> 
> Thank you very much for your time and help.
> HZBilal.
> 
> ---
> Mr Haider Zuhair Bilal BEng MSc MIET MIEEE MBCS
> PhD Research Scholar
> Centre for Systems and Software Engineering
> Faculty of Business, Computing and Information Management
> London South Bank University
> 103 Borough Road
> London SE1 0AA
> UK
> 
> Tel: +44(0)20 7815 7473
> Fax: +44(0)20 7815 7550
> Mobile: +44(0)7887 598355
> 
> http://www.HZBilal.com/
> 
> 
>   ----- Original Message -----
>   From: Danny Yoo
>   To: Bilal, Haider Z
>   Sent: Wednesday, October 11, 2006 4:13 PM
>   Subject: Re: My Scheme Probelm
> 
> 
>   > I am a PhD student at LSBU working on 'Measuring Ripple Effect for
>   > Object oriented software'.
> 
>   Didn't you ask this exact question last week?
> 
>   You did get a response:
> 
>   http://list.cs.brown.edu/pipermail/plt-scheme/2006-October/014899.html
> 
>   If you didn't read it, please do.  I spent time reading that code, and 
> I'd
>   hate that effort to be wasted.
> 
> _________________________________________________
>  For list-related administrative tasks:
>  http://list.cs.brown.edu/mailman/listinfo/plt-scheme


Posted on the users mailing list.