Skip to content
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

Seaside-Squeak-Core String>>#trimBlanks method inhibits porting #64

Closed
GoogleCodeExporter opened this issue Mar 25, 2015 · 9 comments
Closed

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?

1. Inspect:  (Character cr asString, '    abc') trimBlanks 

What is the expected output? What do you see instead?

On Squeak and Dolphin, I see 'abc'; on VW and VA Smalltalk I see '
   abc' (a CR, three spaces, and 3 letters).

What version of the product are you using? On what operating system?

Seaside-Core pmm.141
Seaside-Squeak-Core lr.44
Seaside-Test pmm.112 

Running on WinXP

Please provide any additional information below.

Since the #trimBlanks method actually removes all separators, it seems 
badly named at best.

Both VW and VA Smalltalk implement String>>#trimBlanks to remove only 
spaces, not all separators.  Dolphin's #trimBlanks implementation matches 
Seaside-Squeak-Core; I don't know about GST or Gemstone.

VA Smalltalk has a similar method, #trimSeparators, to remove all 
separators; I have not found a similar method in other implementations.

I suggest changing the Seaside-Squeak-Core String>>#trimBlanks method (and 
references to it) to String>>#trimSeparators to more-correctly describe 
its function as well as aiding porting.

Original issue reported on code.google.com by [email protected] on 6 May 2008 at 4:06

@GoogleCodeExporter
Copy link
Author

After discussing with Lukas, we prefer something like:

#toTrimmed

- it would remove only leading and trailing spaces, no cr, no lf, maybe tabs 
(haven't made up my mind yet)
- the Java-esque #to avoids conflicts

Original comment by [email protected] on 16 May 2008 at 7:48

  • Changed state: Accepted
  • Added labels: Type-Portability
  • Removed labels: Type-Defect

@GoogleCodeExporter
Copy link
Author

I am quite happy with a platform-neutral method.  But I am a bit confused.  If 
the 
intent is to remove only leading and trailing spaces, then the current 
#trimBlanks 
method is a good name and only its underlying implementation in Seaside needs 
to 
change.  On the otherhand, if the intent is to actually trim all separators 
(spaces, 
tabs, cr, lf), which is the current implementation in Seaside, then #toTrimmed 
is a 
good name.  

Original comment by [email protected] on 16 May 2008 at 7:56

  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

Seaside-Utils-Core comes with several String utilities, including powerful 
methods and tests for String trimming.

Original comment by renggli on 16 May 2008 at 9:05

  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

The trimBlanks is an extension method to String from *Seaside-Squeak-Core.
It conflicts with existing trimBlanks methods in VW and VA (probably Dolphin 
too).
Renaming it should solve it.

Original comment by [email protected] on 29 Aug 2008 at 1:30

  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

In seaside-utils-core there is trimBoth, which has the correct behaviour.
Renamed WAPlatformTest testTrimBlanks to testTrimBoth,
Added WAPlatformTest testTrimBoth2 with the issue,
replaced trimBlanks by trimBoth in 
  WAMimeType fromString:
  WAQualifiedValue fromString:
  WARequestCookie keyFrom:
  WARequestCookie trimBlanksAndQuotes:

Original comment by [email protected] on 29 Aug 2008 at 2:09

  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

testTrimBoth2 is not a good name, renamed to testTrimBothWithCr

Original comment by [email protected] on 29 Aug 2008 at 2:18

  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

We must have been 2 working on the same bug:
My work is in Seaside-Tests-YM.141 and Seaside-Core-YM.188

Original comment by [email protected] on 29 Aug 2008 at 2:24

  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

In GST, what I am doing is running a pretty big set of RB rewritings on the 
Squeak
source code when I import it from Monticello.  I just changed "trimBlanks" to
"trimSeparators", and it works.  Maybe other dialects can do the same?  The 
master
version of course remains the Squeak version.

Original comment by [email protected] on 29 Aug 2008 at 2:49

  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

#trimBoth from Seaside-Utils is used now

Original comment by [email protected] on 30 Aug 2008 at 9:03

  • Changed state: Fixed
  • Added labels: Version-Seaside2.9
  • Removed labels: ****

dalehenrich added a commit to dalehenrich/Seaside that referenced this issue Sep 7, 2015
… when logging a commit conflict to the object log, we'll just pass the url of the native request ... unless the GsSocket is sneaking into a persistent root some other (less obvious way) ... logging commit conflicts should now be safe and hopefully the FastCGI-related GsSocket "lost state" errors nuked
dalehenrich pushed a commit to dalehenrich/Seaside that referenced this issue Sep 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant