I was thinking that I would prefer to have
"` '/foo/gloops.taz' asFileReference basename -> 'gloops.taz'.`"
` '/foo/gloops.taz' asFileReference basename -> 'gloops.taz'.` <-
suceeds, no output
So that we can use ` in the future in plain code.
Also it has the advantage that it is backward compatible.
Else we could have
But I do not know.
Tell me what you think.
I would love to browse the complete system to convert existing one liner
Ok, this is a quick hack ( do not look at the code :), yes using regex
here is a bit fragil)
You can add code in comments between backticks (`)
The formatter will highlight the text like smalltalk code (or not if
it is not valid code).
+ an icon styler with an icon showing a warning icon for faulty code
or an information icon otherwise
you can click on the icon,
if the code is an association
expression -> result
it executes the expression and compares it with the result, (with
assert:equals: ) opens debugger if it fails and does
if the code is just an expression, it opens an inspector.
This is just one way to do some tests and experiments with this idea,
don 't yet know if this is a good idea or if
we can / should find a better way to connect code with examples.
first result, I find expressions in comments, highlighted as code,
(file in attached cs in a recent pharo 6.0 and look at the method
AbstractFileReference>>#baseName . Or
add an expression with backticks in a method comment
` your code here `