2017-10-04 16:49 GMT-03:00 Denis Kudriashov :
> 2017-10-04 21:38 GMT+02:00 Esteban A. Maringolo :
>>> It is not compiled time but behaviour is very close to it.
>>> The trick is that first time execution will replace full expression with
>>> the result
2017-10-04 21:38 GMT+02:00 Esteban A. Maringolo :
> 2017-10-04 6:46 GMT-03:00 Denis Kudriashov :
>
>> Hi Igor.
>>
>> Did you see that we have now #asMethodConstant?
>>
>> DateAndTime now asMethodConst
>>
>>
>> It is not compiled time but behaviour is
2017-10-04 6:46 GMT-03:00 Denis Kudriashov :
> Hi Igor.
>
> Did you see that we have now #asMethodConstant?
>
> DateAndTime now asMethodConst
>
>
> It is not compiled time but behaviour is very close to it.
> The trick is that first time execution will replace full
On 4 October 2017 at 22:30, Igor Stasenko wrote:
>
>
> On 4 October 2017 at 17:27, Sean P. DeNigris
> wrote:
>
>> Igor Stasenko wrote
>> > IMO, best would be to make it via compiler plugin.
>>
>> It seems there is always a tension between
On 4 October 2017 at 12:46, Denis Kudriashov wrote:
> Hi Igor.
>
> Did you see that we have now #asMethodConstant?
>
> DateAndTime now asMethodConst
>
>
> It is not compiled time but behaviour is very close to it.
> The trick is that first time execution will replace full
On 4 October 2017 at 17:27, Sean P. DeNigris wrote:
> Igor Stasenko wrote
> > IMO, best would be to make it via compiler plugin.
>
> It seems there is always a tension between newbie-friendliness/purity and
> max-performance/deployment. There are so many other things about
Igor Stasenko wrote
> IMO, best would be to make it via compiler plugin.
It seems there is always a tension between newbie-friendliness/purity and
max-performance/deployment. There are so many other things about a Smalltalk
image that are insecure and any compiler "tricks" are additional places
Hi Igor.
Did you see that we have now #asMethodConstant?
DateAndTime now asMethodConst
It is not compiled time but behaviour is very close to it.
The trick is that first time execution will replace full expression with
the result as literal (the receiver of #asMethodConst). So at second time
> On 4 Oct 2017, at 11:36, Igor Stasenko wrote:
>
> IMO, best would be to make it via compiler plugin.
>
> Same, as i proposed for object literals,
> a compiler could detect a pattern interpolate
Which means the #interpolate message send is compiled away, right ?
So no
IMO, best would be to make it via compiler plugin.
Same, as i proposed for object literals,
a compiler could detect a pattern interpolate
and replace it at compile time to produce/expand it into proper
context-aware semantic, something like this:
{'a' . x . 'b' . y. 'c' .z } gather: #asString
2017-10-04 9:50 GMT+02:00 Guillermo Polito :
> if the compiler plugin correctly models such special syntax with special
> AST nodes, that could be even possible without much effort
>
Interesting. Would that imply that by having those special ast nodes, we
would get the
if the compiler plugin correctly models such special syntax with special
AST nodes, that could be even possible without much effort
On Tue, Oct 3, 2017 at 5:42 PM, Denis Kudriashov
wrote:
>
> 2017-10-03 17:39 GMT+02:00 Denis Kudriashov :
>
>> Hi.
>>
Sven Van Caekenberghe-2 wrote
> Nicolas,
>
>> On 28 Sep 2017, at 23:56, Nicolas Cellier
> nicolas.cellier.aka.nice@
> wrote:
>>
>> Hi Sven,
>> for now it works because the context into which the block is executed
>> still has full access to the variables and receiver of outer context from
>>
2017-10-03 17:39 GMT+02:00 Denis Kudriashov :
> Hi.
>
> While idea looks cool it will require a lot of tool support. Senders,
> var/class references, rename refactorings should be aware of it
>
And I forgot debugger. It should be possible to step over "interpolated
2017-10-03 17:39 GMT+02:00 Denis Kudriashov :
> Hi.
>
> While idea looks cool it will require a lot of tool support. Senders,
> var/class references, rename refactorings should be aware of it
>
Language designers do not care about it of course :)
>
> 2017-10-03 17:29
Hi.
While idea looks cool it will require a lot of tool support. Senders,
var/class references, rename refactorings should be aware of it
2017-10-03 17:29 GMT+02:00 Damien Pollet :
> On 3 October 2017 at 14:07, Guillermo Polito
> wrote:
>
>>
On 3 October 2017 at 14:07, Guillermo Polito
wrote:
> Why not having an opal plugin?
>
> The opal plugin may read strings in the form:
>
> "lalala {some expression} lololo"
>
> and replace at compile time that by:
>
> "lalala {1} lololo" format { some expression }
>
Nicolas,
> On 28 Sep 2017, at 23:56, Nicolas Cellier
> wrote:
>
> Hi Sven,
> for now it works because the context into which the block is executed still
> has full access to the variables and receiver of outer context from which the
> block is declared.
>
Why not having an opal plugin?
The opal plugin may read strings in the form:
"lalala {some expression} lololo"
and replace at compile time that by:
"lalala {1} lololo" format { some expression }
The thing to think about is what is the delimiter for {some expression}.
- a too used one may
> On 29 Sep 2017, at 08:54, Pavel Krivanek wrote:
>
> This solution will not work for environments without sources too where names
> like t1, t2 are used for temporary variables.
That is true.
I often wonder why we can't keep at least the variables names, it would
> On 29 Sep 2017, at 06:40, Hernán Morales Durand
> wrote:
>
> Hi Sven,
>
> Is this one the similar to the #evaluate in
> http://www.squeaksource.com/evaluablestrings ?
Haha, yes that is exactly the same trick.
Lukas & Philippe back in 2005, duh.
> Cheers,
>
>
This solution will not work for environments without sources too where
names like t1, t2 are used for temporary variables.
Anyway, nice idea.
-- Pavel
Dne čtvrtek 28. září 2017 Sven Van Caekenberghe napsal(a):
> Hi,
>
> I got into a little office discussion about string
Hi Sven,
Is this one the similar to the #evaluate in
http://www.squeaksource.com/evaluablestrings ?
Cheers,
Hernán
2017-09-28 11:20 GMT-03:00 Sven Van Caekenberghe :
> Hi,
>
> I got into a little office discussion about string interpolation as it is
> done in different
Hi Sven,
for now it works because the context into which the block is executed still
has full access to the variables and receiver of outer context from which
the block is declared.
But it's not necessarily the case in all dialects.
In VW for example, I get nil instead of foobar
#('loop on value
> On 28 Sep 2017, at 18:50, Nicolas Cellier
> wrote:
>
>
>
> 2017-09-28 16:20 GMT+02:00 Sven Van Caekenberghe :
> Hi,
>
> I got into a little office discussion about string interpolation as it is
> done in different programming languages.
2017-09-28 16:20 GMT+02:00 Sven Van Caekenberghe :
> Hi,
>
> I got into a little office discussion about string interpolation as it is
> done in different programming languages.
>
> In Pharo we have String>>#format: which is pretty nice. It works as
> follows:
>
> | x y |
> x :=
> On 28 Sep 2017, at 18:08, Ron Teitelbaum wrote:
>
> Sorry, I tried to have them included at one point on squeak but I was talked
> down.
>
> I use them a lot! They work with other things besides strings.
In Pharo we have #join: and #split:
$| join: #('Foo' 'Bar').
Sorry, I tried to have them included at one point on squeak but I was
talked down.
I use them a lot! They work with other things besides strings.
Collection >> explode: aDelimiter
"explode the collection into a collection of collections broken by
aDelimiter"
"(#(#(1 2) #(3 4)) mergeDelimited:
>From a book about PHP security, there was a chapter about "tainted
variables".
The concept is that once a variable is written to from a user, all other
variables that come into contact with it should be considered tainted from
a security perspective.
The chapter went about how such variables
> On 28 Sep 2017, at 17:13, Thierry Goubier wrote:
>
>
>
> 2017-09-28 17:08 GMT+02:00 Sven Van Caekenberghe :
>
>
> > On 28 Sep 2017, at 16:58, p...@highoctane.be wrote:
> >
> > I stand corrected.
> >
> > Nuclear style feature then.
> >
> > 'Let me
2017-09-28 17:08 GMT+02:00 Sven Van Caekenberghe :
>
>
> > On 28 Sep 2017, at 16:58, p...@highoctane.be wrote:
> >
> > I stand corrected.
> >
> > Nuclear style feature then.
> >
> > 'Let me get out of here {Smalltalk snapshot:false andQuit: true}. BOOM'
> interpolate
> >
> > Feels
> On 28 Sep 2017, at 16:55, Ron Teitelbaum wrote:
>
> Hi All,
>
> To solve this problem I do this:
>
> replaceTokensIn: aString
> ^self tokens inject: aString into: [:str :assoc |
> ((str explode: assoc key) mergeDelimited: assoc value value)].
>
>
> On 28 Sep 2017, at 16:58, p...@highoctane.be wrote:
>
> I stand corrected.
>
> Nuclear style feature then.
>
> 'Let me get out of here {Smalltalk snapshot:false andQuit: true}. BOOM'
> interpolate
>
> Feels like
>
> STR='sudo reboot'; $(STR)
>
> in bash when one is sudoer.
Yeah, but it
I stand corrected.
Nuclear style feature then.
'Let me get out of here {Smalltalk snapshot:false andQuit: true}. BOOM'
interpolate
Feels like
STR='sudo reboot'; $(STR)
in bash when one is sudoer.
Phil
On Thu, Sep 28, 2017 at 4:43 PM, Sven Van Caekenberghe wrote:
>
>
> > On
Hi All,
To solve this problem I do this:
replaceTokensIn: aString
^self tokens inject: aString into: [:str :assoc |
((str explode: assoc key) mergeDelimited: assoc value value)].
tokens is a collection of key value pairs.
aString := 'Dear {!user}'.
self tokens: {'{!user}' -> [self user]}.
Thierry,
> On 28 Sep 2017, at 16:38, Thierry Goubier wrote:
>
> Hi Sven,
>
> Jason and Andrew wrote a string interpolation implementation for Andrew's
> language, Grace, in the parser. It works rather well and isn't too difficult
> to implement...
Like I said, I
> On 28 Sep 2017, at 16:27, p...@highoctane.be wrote:
>
> We also have
> http://norbert.hartl.name/blog/2013/10/03/mustache-templates-for-smalltalk/
>
> Phil
Yes, Mustache is a cool templating engine, but it is similar to #format: not to
#interpolate. With true string interpolation, you do
Hi Sven,
Jason and Andrew wrote a string interpolation implementation for Andrew's
language, Grace, in the parser. It works rather well and isn't too
difficult to implement...
The equivalent would be to add it to RB Parser, and, security wise, it
would be as vulnerable as calling Compiler
We also have
http://norbert.hartl.name/blog/2013/10/03/mustache-templates-for-smalltalk/
Phil
On Thu, Sep 28, 2017 at 4:20 PM, Sven Van Caekenberghe wrote:
> Hi,
>
> I got into a little office discussion about string interpolation as it is
> done in different programming
39 matches
Mail list logo