Re: [racket-dev] Google Summer of Code&In-Reply-To=<4f3bb42f.7080...@ccs.neu.edu>

2012-02-16 Thread Emil Biga
 
>I'd like to have Android programs that speak the 2htdp/universe protocol >and 
>support World-style programming. I have a quick mock-up of both; I >can play 
>simple games where one player is running a BSL client on a >laptop and the 
>other player is running a Java client on their phone.I'm teaching my students 
>How To Design Classes currently this Spring.I would like to see your quick 
>mock-ups. (and whatever tutorials you can share)I can borrow ten or so android 
>phones from the University of Nebraska at Omaha.Thanks,Emil Biga
_
  Racket Developers list:
  http://lists.racket-lang.org/dev


[racket-dev] Request for max-log-level

2012-02-16 Thread Tobias Hammer

Hi,

i have to synchronize the log levels of a racket logger and an external  
logging
system. Therefore i need the information what the highest logging level of  
a
logger is to already discard any messages in the external system that have  
no

receiver.
Because there is, as far as i know, no possibility to get a notification  
whenever
the internal accepted level changes i have to synchronize pretty often.  
This is
currently only possible by cycling through all levels and check via  
log-level?

which is cumbersome and, at least for my needs, too slow.
Would it be possible to add a function that returns the current maximum  
level of
a logger? The needed information is already stored in  
Scheme_Logger::want_level
but there is no accessor. The following addition (excl. function  
registration)

to error.c would do the job:

static Scheme_Object *
max_log_level(int argc, Scheme_Object *argv[])
{
  Scheme_Logger *logger;
  Scheme_Object *result;

  if (!SAME_TYPE(SCHEME_TYPE(argv[0]), scheme_logger_type))
scheme_wrong_type("max-log-level", "logger", 0, argc, argv);
  logger = (Scheme_Logger *)argv[0];

  if (logger->local_timestamp < *logger->timestamp)
update_want_level(logger);

  switch (logger->want_level)
  {
  case SCHEME_LOG_FATAL: result = fatal_symbol; break;
  case SCHEME_LOG_ERROR: result = error_symbol; break;
  case SCHEME_LOG_WARNING: result = warning_symbol; break;
  case SCHEME_LOG_INFO:  result = info_symbol; break;
  case SCHEME_LOG_DEBUG: result = debug_symbol; break;
  default: result = scheme_false;
  }

  return result;
}

(No patch because i completely messed up with compiled startup and  
expected primitive

count, even after following instructions in schminc.h :( )

Tobias
_
 Racket Developers list:
 http://lists.racket-lang.org/dev