-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WAUrlEncoder not using primitive #31
Comments
@obi068, I'm not quite sure that this is a real issue or perhaps I am misunderstanding what you are asking? |
Hi Dale, I think i only want to point out that the seaside implementation of the I am now using a subclass of WAUrlEncoder with a different initializeTable Gerhard On Tue, May 26, 2015 at 11:43 PM, Dale Henrichs [email protected]
|
Hmmmm, which version of GemStone/Seaside are you using? Nils are handled by failing the primitive and then falling back to Smalltalk code .... I ran into this in 3.3 because the primitives had been changed to throw an error on nils and the Seaside tests started failing ... This is part of the reason I am confused:) |
Gemstone 3.2 and Seaside 3.1 (not the final one)! On Thu, Jun 4, 2015 at 11:35 PM, Dale Henrichs [email protected]
|
Gemstone 3.2.0, 3.2.1, 3.2.6? I'd like to narrow my search down a bit:) A little more detail for the seaside version as well ... a commit SHA would be best ... |
Sorry, GS 3.2.0. Not sure how to find out the version of Seaside. On Tue, Jun 9, 2015 at 1:32 AM, Dale Henrichs [email protected]
|
To get the SHA of a github download, take a look at the directory associated with your github://glassdb/Seaside31:gemstone3.1/repository (an instance of MCGitHubRepository) .. the SHA should be embedded in the path. for example here is a directory path from one of mine:
and the SHA is 7364278... |
Okay, I've also looked at the implementation of primitive 654 for String>>encodeUsing: encodeUsing: encodingArray
"A new instance of the class of the receiver will be returned where
each character in the receiver is replaced by the character or string
from encodingArray that is located at the position in encodingArray for
the character. The ascii value of the character is used as an index
into the encodingArray, value 16r0 accesses encodingArray at:1 .
If the ascii value is >= size of the encodingArray,
nil is returned.
If the value from the encodingArray is a Character with value > 16rFF
or is not a kind of String, nil is returned."
<primitive: 654>
^ nil And it is as I expected ... the primitive doesn't fail when it encounters a nil (or any other unexpected value or size mismatch, etc. in the encodingArray) ... encodeUsing: returns a nil ... The current implementation of WATableBasedEncoder>>nextPutAll: in the GsDevKit variant of Seaside31 handles the nil result correctly: nextPutAll: aString
"#encodeUsing: is a primitive in GemStone, so it does the mapping very quickly..."
| encodedString |
encodedString := aString encodeUsing: table.
encodedString ~~ nil
ifTrue: [ stream nextPutAll: encodedString ]
ifFalse: [ 1 to: aString size do: [ :index | self nextPut: (aString at: index) ] ] So at least for the current version of Seaside31 the use of |
The same method is available in the glassdb variant of Seaside31 with the change made on December 15, 2013... Prior to the fix by @jbrichau the code was indeed wrong: nextPutAll: aString
"uses #to:do: for speed reasons (on Pharo)
this is not premature optimization, this is a hotspot method method
and #to:do: shows measurable speed improvements for rendering seaside pages"
1 to: aString size do: [ :index |
self nextPut: (aString at: index) ] So It looks like you should update your version of Seaside31 to a version that is a bit later ... @jbrichau tagged 3.1.1, so I would think you'd want to upgrade to that point at a minimum as that does correspond to the general 3.1.1 release and includes a fix for this particular bug ... On GsDevKit/Seaside31 we're up to 3.1.4.1 and catching up to that point wouldn't be a bad idea as there are quite a few bugfixes available ... |
From Gerhard:
The text was updated successfully, but these errors were encountered: