* [OT] What langauges have symbols?
@ 2017-06-30 4:24 Marcin Borkowski
2017-06-30 5:15 ` Yuri Khan
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Marcin Borkowski @ 2017-06-30 4:24 UTC (permalink / raw
To: Help Gnu Emacs mailing list
Hi there,
this is clearly OT, but where could I ask that?
What langauges besides Lisps have "symbols"? And I not only mean the
name, of course, but also the properties. For instance, ES6 seems to
have something similar, but it seems to me that you can't have
a variable containing a symbol and say something like
(set var val)
where val is assigned to a variable whose name is the value of var
(i.e., that symbol).
In Elisp, OTOH, you can say e.g.
(set (intern "some-string") 123)
(+ some-string 1)
and obtain 124. My point here is that you can now use a variable called
"some-symbol" without any additional syntax sugar. In yet another
words, we have both set and setq, whereas most languages seem to only
have an equivalent of setq.
TIA,
--
Marcin Borkowski
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [OT] What langauges have symbols?
2017-06-30 4:24 [OT] What langauges have symbols? Marcin Borkowski
@ 2017-06-30 5:15 ` Yuri Khan
2017-06-30 6:10 ` Eli Zaretskii
2017-07-01 0:59 ` Danny YUE
2 siblings, 0 replies; 5+ messages in thread
From: Yuri Khan @ 2017-06-30 5:15 UTC (permalink / raw
To: Marcin Borkowski; +Cc: Help Gnu Emacs mailing list
On Fri, Jun 30, 2017 at 11:24 AM, Marcin Borkowski <mbork@mbork.pl> wrote:
> What langauges besides Lisps have "symbols"? And I not only mean the
> name, of course, but also the properties. For instance, ES6 seems to
> have something similar, but it seems to me that you can't have
> a variable containing a symbol and say something like
> (set var val)
> where val is assigned to a variable whose name is the value of var
> (i.e., that symbol).
You can, kind of.
In Javascript (also known as ECMAScript), there are no global
variables. They are emulated as properties of the global object. The
global object in web browsers is ‘window’.
All objects support setting properties by statically known name:
window.bar = "baz";
console.log(bar); // prints “baz”
or dynamically:
function foo() { return "bar"; }
window[foo()] = "baz";
console.log(bar); // prints “baz”
So, in Javascript, for purposes of setting a variable by computed
name, the closest idea to Lisp’s symbols is a string.
I cannot recall any language other than Lisp that has symbols in the
sense of literal values which are distinct from every other value.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [OT] What langauges have symbols?
2017-06-30 4:24 [OT] What langauges have symbols? Marcin Borkowski
2017-06-30 5:15 ` Yuri Khan
@ 2017-06-30 6:10 ` Eli Zaretskii
2017-07-01 0:59 ` Danny YUE
2 siblings, 0 replies; 5+ messages in thread
From: Eli Zaretskii @ 2017-06-30 6:10 UTC (permalink / raw
To: help-gnu-emacs
> From: Marcin Borkowski <mbork@mbork.pl>
> Date: Fri, 30 Jun 2017 06:24:19 +0200
>
> this is clearly OT, but where could I ask that?
On emacs-tangents, please. That's what that list was created for.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [OT] What langauges have symbols?
2017-06-30 4:24 [OT] What langauges have symbols? Marcin Borkowski
2017-06-30 5:15 ` Yuri Khan
2017-06-30 6:10 ` Eli Zaretskii
@ 2017-07-01 0:59 ` Danny YUE
2017-07-01 3:11 ` Emanuel Berg
2 siblings, 1 reply; 5+ messages in thread
From: Danny YUE @ 2017-07-01 0:59 UTC (permalink / raw
To: Help Gnu Emacs mailing list
On 2017-06-30 04:24, Marcin Borkowski <mbork@mbork.pl> wrote:
> Hi there,
>
> this is clearly OT, but where could I ask that?
>
> What langauges besides Lisps have "symbols"? And I not only mean the
> name, of course, but also the properties. For instance, ES6 seems to
> have something similar, but it seems to me that you can't have
> a variable containing a symbol and say something like
> (set var val)
> where val is assigned to a variable whose name is the value of var
> (i.e., that symbol).
>
> In Elisp, OTOH, you can say e.g.
>
> (set (intern "some-string") 123)
> (+ some-string 1)
>
> and obtain 124. My point here is that you can now use a variable called
> "some-symbol" without any additional syntax sugar. In yet another
> words, we have both set and setq, whereas most languages seem to only
> have an equivalent of setq.
>
> TIA,
Well, Ruby can be counted as one.
http://www.randomhacks.net/2005/12/03/why-ruby-is-an-acceptable-lisp/
https://news.ycombinator.com/item?id=12470715
I think Ruby can be understood as SmallTalk skeleton plus some lisp
spirit.
It has symbols, function keyword arguments, lambda and procedure as high
order function, can call function by name as
`object.send("func_name")`...
Not like "one single way to solve a problem" way, which is definitely
not what lispers like, Ruby provides basic magic and it is your decision
how to use the power.
I am not a Ruby expert, but I learned Common/Emacs Lisp for some years.
I always tried to find another language that are battery-included and
can compare with lisp.
(This is sad because Common Lisp standard has not been updated for too
long, and )
I tried some languages like Go but found it too far from the feeling
that Lisp brings to me, until I met up Ruby.
I think if you want something that can somehow replace Lisp in some
field, especially system scripts, websites or deployable applications,
you can apparently consider Ruby...
Danny
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [OT] What langauges have symbols?
2017-07-01 0:59 ` Danny YUE
@ 2017-07-01 3:11 ` Emanuel Berg
0 siblings, 0 replies; 5+ messages in thread
From: Emanuel Berg @ 2017-07-01 3:11 UTC (permalink / raw
To: help-gnu-emacs
Danny YUE wrote:
> I think if you want something that can
> somehow replace Lisp in some field,
> especially system scripts, websites or
> deployable applications, you can apparently
> consider Ruby...
You can use Lisp for scripts and websites.
As for deployable applications, is that
embedded systems? If so, Lisp should be
perfect, it is *the* most portable language and
even has an AI origin :)
There is nothing in the language that prevents
anyone from doing anything in any field.
Just because it hasn't happened, or hasn't
happened in a way or to an extent someone would
wish, it doesn't follow the field and Lisp
don't merge.
The reason Lisp isn't more spread is because it
is too good. Just like McDonald restaurants are
more prolific than 5 star restaurants. Or maybe
you can get only 4 stars, I actually never
attended anyone...
--
underground experts united
http://user.it.uu.se/~embe8573
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2017-07-01 3:11 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-30 4:24 [OT] What langauges have symbols? Marcin Borkowski
2017-06-30 5:15 ` Yuri Khan
2017-06-30 6:10 ` Eli Zaretskii
2017-07-01 0:59 ` Danny YUE
2017-07-01 3:11 ` Emanuel Berg
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.