<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.3059" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><FONT face="Trebuchet MS" color=#0000ff size=2><SPAN 
class=234484717-02042007>Hi there,</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face="Trebuchet MS" color=#0000ff size=2><SPAN 
class=234484717-02042007></SPAN></FONT>&nbsp;</DIV>
<DIV dir=ltr align=left><FONT face="Trebuchet MS" color=#0000ff size=2><SPAN 
class=234484717-02042007>&nbsp;&nbsp;&nbsp; I found this Squeak specific issue 
that is used by Glorp.</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face="Trebuchet MS" color=#0000ff size=2><SPAN 
class=234484717-02042007></SPAN></FONT>&nbsp;</DIV>
<DIV dir=ltr align=left><FONT face="Trebuchet MS" color=#0000ff size=2><SPAN 
class=234484717-02042007>&nbsp;&nbsp;&nbsp; cheers,</SPAN></FONT></DIV>
<DIV><FONT face="Trebuchet MS" color=#0000ff size=2></FONT>&nbsp;</DIV>
<DIV align=left><SPAN class=250542422-20122006>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt" align=left><?xml:namespace prefix 
= st1 ns = "urn:schemas-microsoft-com:office:smarttags" /><st1:PersonName 
ProductID="Sebastian Sastre&#13;" w:st="on"><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Trebuchet MS'">Sebastian 
Sastre<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" 
/><o:p></o:p></SPAN></st1:PersonName></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt">
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: justify"><SPAN 
lang=ES-AR 
style="FONT-SIZE: 7.5pt; FONT-FAMILY: Verdana; mso-ansi-language: ES-AR"></SPAN><SPAN 
lang=ES-AR style="mso-ansi-language: ES-AR"><o:p><FONT face="Trebuchet MS" 
color=#0000ff size=2></FONT></o:p></SPAN></P></SPAN></P></DIV><BR>
<BLOCKQUOTE dir=ltr 
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
  <DIV class=OutlookMessageHeader lang=es dir=ltr align=left>
  <HR tabIndex=-1>
  <FONT face=Tahoma size=2><B>De:</B> Alan Knight [mailto:knight@acm.org] 
  <BR><B>Enviado el:</B> Sábado, 31 de Marzo de 2007 22:41<BR><B>Para:</B> 
  Sebastian Sastre; glorp-development@lists.sourceforge.net<BR><B>Asunto:</B> 
  Re: [Glorp-development] SmallInteger&gt;&gt;printPaddedWith:to:base: should 
  consider padded only the number right?<BR></FONT><BR></DIV>
  <DIV></DIV><FONT size=3>Yes, that's what I'd expect too. But I note that that 
  sounds to me like a more general Squeak issue. Unless the Glorp port for 
  Squeak is adding the printOn:paddedWith:to:base: method. And then that sounds 
  like something to pester Todd about :-)<BR><BR>At 08:37 PM 3/29/2007, 
  Sebastian Sastre wrote:<BR></FONT>
  <BLOCKQUOTE class=cite cite="" type="cite"><FONT face="Trebuchet MS" 
    size=2>Hi there,<BR></FONT><FONT size=3>&nbsp;<BR></FONT><FONT 
    face="Trebuchet MS" size=2>&nbsp;&nbsp;&nbsp; trying to store some binary 
    content on a postgreSQL database with Glorp lead me to see how SmallInteger 
    does it's octal representation.<BR></FONT><FONT 
    size=3>&nbsp;<BR></FONT><FONT face="Trebuchet MS" size=2>&nbsp;&nbsp;&nbsp; 
    If you evaluate:<BR></FONT><FONT size=3>&nbsp;<BR></FONT><FONT 
    face="Trebuchet MS" size=2>&nbsp;str := String new writeStream.<BR>&nbsp;12 
    printOn: str paddedWith: $0 to: 3 base: 8.<BR>&nbsp;str&nbsp; <BR>a 
    displayIt on the str gives you:&nbsp; a WriteStream '8r14'<BR></FONT><FONT 
    size=3>&nbsp;<BR></FONT><FONT face="Trebuchet MS" size=2>&nbsp;&nbsp;&nbsp; 
    This was suprising. I rather would espect '8r014' or '014' (as in 
    VisualWorks) because the padded size is related to the size of the symbolic 
    representation of the number (without involving it's header wich only 
    indicates how one should make the interpretation of the symbolic 
    representation of the number).<BR></FONT><FONT size=3>&nbsp;<BR></FONT><FONT 
    face="Trebuchet MS" size=2>&nbsp;&nbsp;&nbsp; cheers,</FONT><FONT 
    size=3>&nbsp;&nbsp;&nbsp; <BR>&nbsp;<BR><BR>&lt;?xml:namespace prefix = st1 
    ns = "urn:schemas-microsoft-com:office:smarttags" /&gt;Sebastian 
    Sastre<BR><BR>&lt;?xml:namespace prefix = o ns = 
    "urn:schemas-microsoft-com:office:office" /&gt; <BR></FONT><FONT 
    face="Trebuchet MS" size=2>PD1: this method is expecting that 
    #printOn:base:showRadix DO NOT print the radix header:<BR></FONT><FONT 
    size=3>&nbsp;<BR></FONT><FONT face="Trebuchet MS" size=2>printPaddedWith: 
    aCharacter to: anInteger base: aRadix <BR>&nbsp;"Answer the string 
    containing the ASCII representation of the receiver <BR>&nbsp;padded on the 
    left with aCharacter to be at least anInteger characters."<BR>&nbsp;| 
    aStream padding digits |<BR>&nbsp;#Numeric.<BR>&nbsp;"2000/03/04&nbsp; 
    Harmon R. Added Date and Time support"<BR>&nbsp;aStream := WriteStream on: 
    (String new: 10).<BR>&nbsp;self<BR>&nbsp; printOn: aStream<BR>&nbsp; base: 
    aRadix<BR>&nbsp; showRadix: false.<BR>&nbsp;digits := aStream 
    contents.<BR>&nbsp;padding := anInteger - digits size.<BR>&nbsp;padding &gt; 
    0 ifFalse: [^ digits].<BR>&nbsp;^ ((String new: padding) atAllPut: 
    aCharacter;<BR>&nbsp; yourself) , digits<BR></FONT><FONT 
    size=3>&nbsp;<BR></FONT><FONT face="Trebuchet MS" size=2>PD2: so.. it would 
    act as expected if we patch #printOn:base:showRadix to:<BR></FONT><FONT 
    size=3>&nbsp;<BR></FONT><FONT face="Trebuchet MS" 
    size=2>SmallInteger&gt;&gt;printOn: outputStream base: baseInteger 
    showRadix: flagBoolean <BR>&nbsp;"Write a sequence of characters that 
    describes the receiver in radix <BR>&nbsp;baseInteger with optional radix 
    specifier. <BR>&nbsp;The result is undefined if baseInteger less than 2 or 
    greater than 36."<BR>&nbsp;| tempString startPos 
    |<BR>&nbsp;#Numeric.<BR>&nbsp;"2000/03/04&nbsp; Harmon R. Added ANSI 
    &lt;integer&gt; protocol"<BR>&nbsp;tempString := self printStringRadix: 
    baseInteger.<BR>&nbsp;"rh 6/9/2005 20:24 change to make it half-work (when 
    you don't want radix printed) instead of being completely 
    broken"<BR>&nbsp;flagBoolean ifTrue: [^ outputStream nextPutAll: 
    tempString].<BR>&nbsp;startPos := (tempString indexOf: $r ifAbsent: [self 
    error: 'radix indicator not found.'])<BR>&nbsp;&nbsp;&nbsp; + 
    1.<BR>&nbsp;self negative ifTrue: [outputStream nextPut: 
    $-].<BR>&nbsp;outputStream nextPutAll: (tempString copyFrom: startPos to: 
    tempString size)<BR></FONT><FONT 
    size=3>&nbsp;<BR>-------------------------------------------------------------------------<BR>Take 
    Surveys. Earn Cash. Influence the Future of IT<BR>Join SourceForge.net's 
    Techsay panel and you'll get the chance to share your<BR>opinions on IT 
    &amp; business topics through brief surveys-and earn cash<BR><A 
    href="http://www.techsay.com/default.php?page=join.php&amp;p=sourceforge&amp;CID=DEVDEV" 
    eudora="autourl">http://www.techsay.com/default.php?page=join.php&amp;p=sourceforge&amp;CID=DEVDEV</A> 
    <BR>_______________________________________________<BR>Glorp-development 
    mailing list<BR>Glorp-development@lists.sourceforge.net<BR><A 
    href="https://lists.sourceforge.net/lists/listinfo/glorp-development" 
    eudora="autourl">https://lists.sourceforge.net/lists/listinfo/glorp-development</A></FONT> 
  </BLOCKQUOTE><BR>
  <DIV>--</DIV>
  <DIV>Alan Knight [|], Cincom Smalltalk Development</DIV>
  <DIV>knight@acm.org</DIV>
  <DIV>aknight@cincom.com</DIV>
  <DIV><A href="http://www.cincom.com/smalltalk" 
  EUDORA="AUTOURL">http://www.cincom.com/smalltalk</A></DIV><BR>
  <DIV>"The Static Typing Philosophy: Make it fast. Make it right. Make it run." 
  - Niall Ross</DIV></BLOCKQUOTE></BODY></HTML>