Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

r2e doesn't affect Strings

#16

Calling: reia_erl:r2e(reia:apply('Ryan',out, [Abs_Path, Method, PathParts, Cookie, Params])).

Ryan.out returns (~redirect, "something.com") in erlang that looks as {tuple,{redirect,{string,<<"something.com">>}}}

after r2e we get {redirect,{string,<<"something.com">>}}

Since r2e uses list comprehension, it'a ok with containing values, but strings are not converted from Reia to Erlang properly, and there's currently no way to work it around when returning values in different formats: (~html, "contents") ~ok (~status, 404) (~content, 'application/pdf', 'PDF/#4...')

i suggest adding: r2e({string, String}) -> String; to reia_erl

Reported by Philipp Pirozhkov · December 28th, 2008 @ 06:14 PM

State: resolved
Milestone: none
Assigned to: Tony Arcieri Tony Arcieri

Activity

  1. Philipp Pirozhkov
    Philipp Pirozhkov

    applying my suggested patch breaks code in many pieces, there should be another solution. I'll work it around until typing system is stable

    December 28th, 2008 @ 06:48 PM

  2. Tony Arcieri
    Tony Arcieri
    • State changed from new to resolved

    Reia calls out into the Erlang environment in several places. Since there's no Erlang equivalent of a string (a collection of characters) as a distinct entity from a list, strings need to be preserved in their internal Reia representation. I plan switching the internal representation of strings to a more iolist-like internal representation, using nested lists of binaries which are lazily flattened when necessary.

    As a workaround for interfacing with the Erlang environment, for the time being I'd suggest you have Ryan.out return (~redirect, "something.com".to_list()). In the future you can pretty this up with default arguments and keyword args which let you control what type is returned.

    So, consider this closed "by design"

    December 28th, 2008 @ 07:01 PM

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.