Diff for /parser3/www/htdocs/Attic/_bug.html between versions 1.35 and 1.77

version 1.35, 2004/03/25 11:51:19 version 1.77, 2004/12/23 15:50:27
Line 1 Line 1
 @auto[]  
 $request:charset[windows-1251]  
 $response:charset[windows-1251]  
   
   
 @main[]  
 $table[^table::create{pet  
 cat     milk}]  
 $hash[^table.hash[pet]]  
 ^display[$hash]  
   
 @main[]  
 ^connect[mysql://root@localhost/paf]{  
   
 $hash[^hash::sql{select 'cat' as pet  
 #, 'milk' as food  
 }]  
 ^display_hash[$hash]  
   
   
 }  
   
 @main[]  @main[]
 ^connect[mysql://root@localhost/paf]{  ^bug[]
         $participants[^hash::sql{select 'feodor' as participant }]  
 }  
   
 #:даст хеш такой структуры:  
 $participantsZ[  
         $.alex(1)  
         $.boris(1)  
 ]  
   
 #:из которого можно эффективно извлекать информацию, например, так:  @unhandled_exception[exception;stack]
 $person[feodor]  unhandled_exception
 $person ^if($participants.$person){участвует}{не участвует} в мероприятии  #do not log it
 }  $exception.handled(1)
   
   
 @display_hash[hash]  
 #$hash.a.a  
 ^hash.foreach[k;v]{hash $k=(  
 ^if($v is hash){^display_hash[$v]}{  
 ^if($v is bool){bool ^if($v){true;false}}{string $v}  
 }  
 }[,]  
   
 )^#0A}]  
   
   
 @main[]  
 $name[ Вася ]  
 "$name"  
 "^name.trim[]"  
   
 $path[/section/subsection/]  
 ^path.trim[end;/]  
   
 @main[]  
 $xdoc[^xdoc::create{<?xml version="1.0"?>  
 <document xmlns:s="urn:special">  
         <s:code>string</s:code>  
 </document>  
 }]  
 $xdoc.search-namespaces.s[urn:special]  
 ^xdoc.selectString[string(//s:code)]  
   

Removed from v.1.35  
changed lines
  Added in v.1.77


E-mail: