These aren't really bugs that i've found, but I had a couple of comments I
guess.
(Really they are rather trivial syntax nits).
When writing strings, it might be nice for the " " syntax to auto-quote.
So instead of "ABCD" expanding to [A B C D], it would expand to '[A B C D].
I haven't really found a situation where I need a string literal and I'm not
interested in having it quoted.
(Maybe there is one and I haven't thought of it yet).
The other thing I was thinking about was the function syntax. For example,
if I want to use a function in another module without importing it, i would
have to do something like:
(: module function-name args)
or
(call module function-name args)
And that is fine and makes sense from a lispy perspective.
And you can also import it in the module header using the import argument,
which is also useful.
But i was wondering how possible/hard it would be to put back in the normal
erlang syntax of (module:function args)?
I think that that is how it is in a lot of lisps (common lisp is
package:function, clojure is namespace/function, not sure about scheme).
It something to think about, anyway, as in general in lisp it seems like the
first thing in the list is the function name, everything else is the
argument.
With (: ) syntax, I end up having to look at the third argument, which to me
is a little confusing and ends up being fairly conceptually different.
Anyway, I'm enjoying the language, my project using it is going quite well!
Thanks,
-Jon
On Thu, Dec 17, 2009 at 6:48 PM, rvirding <rvird
...@gmail.com> wrote:
> Sorry guys, there is as yet no way to directly put a string into a
> binary. This is not because I don't want to but because I haven't
> thought up a good syntax for it. The problem is that a string just
> becomes a list of integers. I'll fix it real soon now.
> The #b( ... ) is mainly useful for printing binaries, not so much for
> input. For input you can use all the bit segments that are valid for
> (binary ... ) but only with constant values. So you can create a
> binary with:
> #b(1 (2 (size 64)) (1.5 float (size 32)))
> There is actually very little use for this, in compiled code none at
> all, but it is there for completeness. When a binary is printed it is
> printed using bytes with a size field last when necessary:
> > (binary 1 2 (3 (size 10)))
> #B(1 2 0 (3 (size 2)))
> I will fix the strings soon,
> Robert
> P.S. Any other bugs been found?
> On Dec 18, 12:05 am, dysinger <t...@dysinger.net> wrote:
> > No I tried every combo under the sun I could think of with b# - didn't
> > work
> > ~ make repl
> > Erlang R13B03 (erts-5.7.4) [source] [64-bit] [smp:2:2] [rq:2] [async-
> > threads:0] [kernel-poll:false]
> > LFE Shell V5.7.4 (abort with ^G)> #b"hello"
> > exception exit: #(error #(1 lfe_scan #(illegal "#b\"")) 1)
> > in (lfe_io scan_and_parse 2)
> > > #b("hello")
> > exception exit: #(error #(1 lfe_parse #(illegal binary)))
> > in (lfe_io scan_and_parse 2)
> > > #b('"hello")
> > exception exit: #(error #(1 lfe_parse #(illegal binary)))
> > in (lfe_io scan_and_parse 2)
> > > (list_to_binary '"hello")
> > #B(104 101 108 108 111)
> > List to binary is the only one that works - it's really verbose though
> > so I renamed in in the import to "l2b"
> > -Tim
> > On Dec 17, 10:57 am, Jonathan Smith <jonathansmith...@gmail.com>
> > wrote:
> > > You may have already tried this, but...
> > > It looks like there is a #b( ) reader macro for binary constants.
> "hello" is
> > > a list of integers, so maybe you can try #b"hello" ?
> > > On Thu, Dec 17, 2009 at 8:01 AM, dysinger <t...@dysinger.net> wrote:
> > > > There is this (list_to_binary '"hello") .....but I thought for sure
> > > > there was a short-hand macro for it. ?
> > > > On Dec 17, 2:32 am, dysinger <t...@dysinger.net> wrote:
> > > > > I am struggling at the moment to remember how to get a binary
> string
> > > > > in LFE ( <<"likethis">> ) . :)
> > > > --
> > > > You received this message because you are subscribed to the Google
> Groups
> > > > "Lisp Flavoured Erlang" group.
> > > > To post to this group, send email to
> > > > lisp-flavoured-erlang@googlegroups.com.
> > > > To unsubscribe from this group, send email to
> > > > lisp-flavoured-erlang+unsubscribe@googlegroups.com<lisp-flavoured-erlang%2B unsubscribe@googlegroups.com><lisp-flavoured-erlang%2B
> unsubscribe@googlegroups.com>
> > > > .
> > > > For more options, visit this group at
> > > >http://groups.google.com/group/lisp-flavoured-erlang?hl=en.
> --
> You received this message because you are subscribed to the Google Groups
> "Lisp Flavoured Erlang" group.
> To post to this group, send email to
> lisp-flavoured-erlang@googlegroups.com.
> To unsubscribe from this group, send email to
> lisp-flavoured-erlang+unsubscribe@googlegroups.com<lisp-flavoured-erlang%2B unsubscribe@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/lisp-flavoured-erlang?hl=en.