[#65451] [ruby-trunk - Feature #10333] [PATCH 3/1] optimize: "yoda literal" == string — ko1@...
Issue #10333 has been updated by Koichi Sasada.
9 messages
2014/10/07
[#65458] Re: [ruby-trunk - Feature #10333] [PATCH 3/1] optimize: "yoda literal" == string
— Eric Wong <normalperson@...>
2014/10/07
[email protected] wrote:
[#65502] Re: [ruby-trunk - Feature #10333] [PATCH 3/1] optimize: "yoda literal" == string
— Eric Wong <normalperson@...>
2014/10/08
Eric Wong <[email protected]> wrote:
[#65538] Re: [ruby-trunk - Feature #10333] [PATCH 3/1] optimize: "yoda literal" == string
— Eric Wong <normalperson@...>
2014/10/09
Eric Wong <[email protected]> wrote:
[#65549] Re: [ruby-trunk - Feature #10333] [PATCH 3/1] optimize: "yoda literal" == string
— SASADA Koichi <ko1@...>
2014/10/09
On 2014/10/09 11:04, Eric Wong wrote:
[#65551] Re: [ruby-trunk - Feature #10333] [PATCH 3/1] optimize: "yoda literal" == string
— Eric Wong <normalperson@...>
2014/10/09
SASADA Koichi <[email protected]> wrote:
[#65453] [ruby-trunk - Feature #10328] [PATCH] make OPT_SUPPORT_JOKE a proper VM option — ko1@...
Issue #10328 has been updated by Koichi Sasada.
3 messages
2014/10/07
[#65559] is there a name for this? — Xavier Noria <fxn@...>
When describing stuff about constants (working in their guide), you often
7 messages
2014/10/09
[#65560] Re: is there a name for this?
— Nobuyoshi Nakada <nobu@...>
2014/10/09
On 2014/10/09 20:41, Xavier Noria wrote:
[#65561] Re: is there a name for this?
— Xavier Noria <fxn@...>
2014/10/09
On Thu, Oct 9, 2014 at 1:59 PM, Nobuyoshi Nakada <[email protected]> wrote:
[#65566] [ruby-trunk - Feature #10351] [Open] [PATCH] prevent CVE-2014-6277 — shyouhei@...
Issue #10351 has been reported by Shyouhei Urabe.
3 messages
2014/10/09
[#65741] Re: [ruby-cvs:55121] normal:r47971 (trunk): test/ruby/test_rubyoptions.rb: fix race — Nobuyoshi Nakada <nobu@...>
On 2014/10/16 10:10, [email protected] wrote:
5 messages
2014/10/16
[#65742] Re: [ruby-cvs:55121] normal:r47971 (trunk): test/ruby/test_rubyoptions.rb: fix race
— Eric Wong <normalperson@...>
2014/10/16
Nobuyoshi Nakada <[email protected]> wrote:
[#65750] Re: [ruby-cvs:55121] normal:r47971 (trunk): test/ruby/test_rubyoptions.rb: fix race
— Tanaka Akira <akr@...>
2014/10/16
2014-10-16 12:48 GMT+09:00 Eric Wong <[email protected]>:
[#65753] [ruby-trunk - Feature #10333] [PATCH 3/1] optimize: "yoda literal" == string — ko1@...
Issue #10333 has been updated by Koichi Sasada.
3 messages
2014/10/16
[#65818] [ruby-trunk - Feature #10351] [PATCH] prevent CVE-2014-6277 — shyouhei@...
Issue #10351 has been updated by Shyouhei Urabe.
3 messages
2014/10/20
[ruby-core:65346] [ruby-trunk - misc #10312] Give people more control over how the ruby parser sees code and lexical code elements (valid/invalid - toggle options) + macros
From:
shevegen@...
Date:
2014-10-01 19:14:55 UTC
List:
ruby-core #65346
Issue #10312 has been updated by Robert A. Heiler.
Hi,
The problem is that they are extremely similar to the other solutions
such as:
jquery :+
Like
jquery.+
Not counting the ' ' character, that one has the same amount of
tokens as the above variant with a Symbol.
+jquery
May be an option but I am not allowed to use a ' ' character?
+ jquery
?
So preferentially I'd prefer it to be
jquery +
----------------------------------------
misc #10312: Give people more control over how the ruby parser sees code and lexical code elements (valid/invalid - toggle options) + macros
https://bugs.ruby-lang.org/issues/10312#change-49159
* Author: Robert A. Heiler
* Status: Open
* Priority: Low
* Assignee:
* Category:
* Target version:
----------------------------------------
Hi,
I am aware that this proposal has most likely not a chance for
implementation, but I'd still like to make it - this is why I
put it here into misc rather than bugs or features. It's misc -
like ideas!
So first allow me to introduce how I came up with this idea at
all.
I have built a "web framework", which is pretty ugly, but
useful to me. It is actually less of a web framework and
more of a way to describe a "web app" - right now using
valid ruby syntax, but hopefully one day I can transition
into something that is even terser than what it is right
now, and eventually becomes valid ruby (or css or javascript
etc... a bit like HaXe http://haxe.org/ but with a more
elegant syntax resembling ruby rather than java)
I describe a web-page currently such as that way:
w {
title 'My little page'
css_style '
body {
padding: 0.20em;
}'
favicon 'foo/bar.png'
font_size '20px'
use_jquery
}
Ok, w is simply a method call w() returning an instance of class
WebObject, and we pass it a block. The block I use for a DSL-like
approach to describe the page in question. For instance, use_jquery
simply is in fact w.use_jquery - so it is a method call on that
web object.
Before that, I was using this line here:
jquery :+
The + reminds me of "yes, enable jquery".
Obviously, to disable jquery, I would do:
jquery :-
Then I thought - "Hey, it would be cool if I could do this:
jquery +
instead. In other words, get rid of the : symbol identifier.
But here the ruby parser rightfully chokes because it does not
understand what is meant with jquery +. Fair enough, this is
not valid ruby.
But to my human eyes, jquery + reads nicer than jquery :+
I could get away doing this instead and treat it as a String:
'jquery +'
And simply parse that with ruby. But I already use:
use_jquery
above, so that is nicer IMO than using the two ' characters.
So now, sorry for that long introduction but perhaps you can
understand my line of thought here.
So I was thinking it would be nice if people could get more
control over the Ruby Parser itself.
For instance, in the above example and only for that file/class,
I would like to tell the ruby parser "hey dude, don't mind if
that specific block has invalid syntax, I'd parse on my own.
Possibly it would be enough if those invalid syntax elements
could become strings - then I can parse those strings on my
own.
Of course the net gain between:
jquery :+
and
jquery +
is minimal, but I love ruby's terse syntax.
Anyway, I am aware that this has no real chance for the ruby
2.x era but perhaps considering all the ideas in regards to
optional static type information and what-not for 3.x ruby era,
more control over the ruby parser itself would be nice
(lisp-like macros!).
Regards.
--
https://bugs.ruby-lang.org/