<!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> </DIV>
<DIV dir=ltr align=left><FONT face="Trebuchet MS" color=#0000ff size=2><SPAN
class=234484717-02042007> 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> </DIV>
<DIV dir=ltr align=left><FONT face="Trebuchet MS" color=#0000ff size=2><SPAN
class=234484717-02042007> cheers,</SPAN></FONT></DIV>
<DIV><FONT face="Trebuchet MS" color=#0000ff size=2></FONT> </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 " 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>>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> <BR></FONT><FONT
face="Trebuchet MS" size=2> 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> <BR></FONT><FONT face="Trebuchet MS" size=2>
If you evaluate:<BR></FONT><FONT size=3> <BR></FONT><FONT
face="Trebuchet MS" size=2> str := String new writeStream.<BR> 12
printOn: str paddedWith: $0 to: 3 base: 8.<BR> str <BR>a
displayIt on the str gives you: a WriteStream '8r14'<BR></FONT><FONT
size=3> <BR></FONT><FONT face="Trebuchet MS" size=2>
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> <BR></FONT><FONT
face="Trebuchet MS" size=2> cheers,</FONT><FONT
size=3> <BR> <BR><BR><?xml:namespace prefix = st1
ns = "urn:schemas-microsoft-com:office:smarttags" />Sebastian
Sastre<BR><BR><?xml:namespace prefix = o ns =
"urn:schemas-microsoft-com:office:office" /> <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> <BR></FONT><FONT face="Trebuchet MS" size=2>printPaddedWith:
aCharacter to: anInteger base: aRadix <BR> "Answer the string
containing the ASCII representation of the receiver <BR> padded on the
left with aCharacter to be at least anInteger characters."<BR> |
aStream padding digits |<BR> #Numeric.<BR> "2000/03/04
Harmon R. Added Date and Time support"<BR> aStream := WriteStream on:
(String new: 10).<BR> self<BR> printOn: aStream<BR> base:
aRadix<BR> showRadix: false.<BR> digits := aStream
contents.<BR> padding := anInteger - digits size.<BR> padding >
0 ifFalse: [^ digits].<BR> ^ ((String new: padding) atAllPut:
aCharacter;<BR> yourself) , digits<BR></FONT><FONT
size=3> <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> <BR></FONT><FONT face="Trebuchet MS"
size=2>SmallInteger>>printOn: outputStream base: baseInteger
showRadix: flagBoolean <BR> "Write a sequence of characters that
describes the receiver in radix <BR> baseInteger with optional radix
specifier. <BR> The result is undefined if baseInteger less than 2 or
greater than 36."<BR> | tempString startPos
|<BR> #Numeric.<BR> "2000/03/04 Harmon R. Added ANSI
<integer> protocol"<BR> tempString := self printStringRadix:
baseInteger.<BR> "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> flagBoolean ifTrue: [^ outputStream nextPutAll:
tempString].<BR> startPos := (tempString indexOf: $r ifAbsent: [self
error: 'radix indicator not found.'])<BR> +
1.<BR> self negative ifTrue: [outputStream nextPut:
$-].<BR> outputStream nextPutAll: (tempString copyFrom: startPos to:
tempString size)<BR></FONT><FONT
size=3> <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
& business topics through brief surveys-and earn cash<BR><A
href="http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV"
eudora="autourl">http://www.techsay.com/default.php?page=join.php&p=sourceforge&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>