Forum

by Jocelyn-Fiat (modified: 2018 Sep 05)

:: Welcome :: Forum

Eiffel related groups and forums:

Check the latest messages:

  • Nov 15
    Re: [eiffel-users] Re: index_small_enough -> ARRAYED_LIST[PATH] bug or misuse?
    If you want to avoid duplicating memory, you should not use `across` but `from until loop` instead and move the cursor according to your deletion or addition (e.g. not call `forth` if the deletion already moved the cursor to the next item). -- Eric Bezault mailto:er...@gobosoft.com
  • Nov 15
    Re: index_small_enough -> ARRAYED_LIST[PATH] bug or misuse?
    Is it because I prune while I'm iterating? On Friday, November 15, 2019 at 4:02:42 PM UTC, Gachoud Philippe wrote: > > Hi, > > a case which seems very simple to me but where I'm missing something... > > I have some > > files_entries: ARRAYED_LIST[PATH] > > > which I fill with a DIRECTORY_ITERATOR >
  • Nov 15
    Re: [eiffel-users] Re: index_small_enough -> ARRAYED_LIST[PATH] bug or misuse?
    And there's the other solution. :-)
  • Nov 15
    index_small_enough -> ARRAYED_LIST[PATH] bug or misuse?
    Hi, a case which seems very simple to me but where I'm missing something... I have some files_entries: ARRAYED_LIST[PATH] which I fill with a DIRECTORY_ITERATOR When I try to remove some based on a regex I get a index_small_enough: CHECK_VIOLATION raised > error. With what am I wrong,
  • Nov 15
    Re: [eiffel-users] Re: index_small_enough -> ARRAYED_LIST[PATH] bug or misuse?
    I think you have identified the issue you are referring to. Do not prune (or grow) what you iterate—ever! Horrid source of bugs. Instead, create a twin and prune or grow the twin and then either send the collection to whatever needs it—or—replace your source list.
  • Nov 15
    Re: [eiffel-users] Re: index_small_enough -> ARRAYED_LIST[PATH] bug or misuse?
    Many thx Larry, I wanted to avoid memory loss, as if I was paying it myself ;-) On Friday, November 15, 2019 at 4:13:06 PM UTC, Larry Rix wrote: > > I think you have identified the issue you are referring to. Do not prune > (or grow) what you iterate—ever! Horrid source of bugs. > > Instead,
  • Nov 15
    Re: [eiffel-users] Re: WrapC VS SOD
    I am back on Slack if you happen to be on and available.
  • Nov 15
    FIle handling in Eiffel

    Given a file input.txt, which consists of a number of elements in arrays and elements in the arrays, I should read the data and copy it to arrays in Eiffel. For example, for

    3 
    3 4 5
    2 3 1
    

    I should get len = 3, a1 = {3,4,5}, a2 = {2,3,1}.

    I have tried the following but it was not successful

    take_input
            -- Read user's input.
        local
            input: PLAIN_TEXT_FILE
            output: PLAIN_TEXT_FILE
            itr: INTEGER
        do
            create input.make_open_read ("input.txt")
            input.read_integer
            len := input.last_integer
            create output.make_open_write ("output.txt")
            create num.make_filled (0, 1, len)
            create rem.make_filled (0, 1, len)
            from
                input.start
                input.read_integer
                itr := 0
            until
                input.off
            loop
                itr := itr + 1
                if itr <= len then
                    num [itr] := input.last_integer
                    input.read_integer
                else
                    rem [itr - len] := input.last_integer
                    input.read_integer
                end
            end
            input.close
        end
    

    Here Is there any way I can continously read the inputs rather than again starting from the Begginning of the file?

  • Nov 15
    How to send an email with eiffel kernel library

    How can a mail be sent in eiffel with kernel library? which class to use?

  • Nov 14
    Some ways to sort a collection of comparables in eiffel

    Which library of the kernel should I use to sort a collection in eiffel?

    where can I find an example of sort? are the tipical bubble sort, etc available?

    Any sorter with agent would be very useful too to avoid having to do it with a comparable which is not implemented for example with PATH class

  • Nov 13
    Re: [eiffel-users] Re: WrapC VS SOD
    Yes, let's continue using slack. On Wednesday, November 13, 2019 at 3:08:08 PM UTC-3, Larry Rix wrote: > > If you look in your Slack eiffel-web personal channel you will find some > additional information from me. >
  • Nov 13
    Re: [eiffel-users] Re: WrapC VS SOD
    BTW--I made you a collaborator on the GitHub project. Feel free to clone and make any direct changes you like. I know I have hard coded paths, but change them to what you like and need and I can then make alterations/modifications on my end afterwards. On Wednesday, November 13, 2019 at 11:54:32
  • Nov 13
    Re: [eiffel-users] Re: WrapC VS SOD
    If you look in your Slack eiffel-web personal channel you will find some additional information from me.
  • Nov 13
    Re: [eiffel-users] Re: WrapC VS SOD
    I have pushed two changes to GitHub: 1. In the ECF, changed the total order of reals from false to true. 2. I saved the output of the external compilation to a file to preserve it. Item #1 handled a reported error, which suggested the change made to the ECF. Subsequent compiles no
  • Nov 13
    Re: [eiffel-users] Re: WrapC VS SOD
    BTW—I attempted to use the versions of stddef.h that shipped with Eiffel Studio, but got errors when using them. I am presuming that the typedefs in the stddef.h file I used from MIT are incorrect given the sod.h, its code, and the compiler I am using. I am also flying blind about my Advanced
  • Nov 13
    Re: [eiffel-users] Re: WrapC VS SOD
  • Nov 13
    Re: [eiffel-users] Re: WrapC VS SOD
    Javier, I used the stddef.h file found at: http://web.mit.edu/cygwin/cygwin_vold/i586-cygwin32/include/mingw32/stddef.h I co-located this in the "sod" folder (the repo folder cloned from GitHub). I referenced the file in the sod.h with the following: #include "D:\Users\LJR19\Documents\GitHub\so
  • Nov 13
    Re: [eiffel-users] Re: WrapC VS SOD
    The failure is because the wrap_c.exe cannot locate the stddef.h file. The only way I could get it to work was to use a stddef.h file I found and placed directly in the sod folder. [image: image.png]
  • Nov 13
    Re: [eiffel-users] Re: WrapC VS SOD
    Hi Larry, do you have a github repository with the code? Can you show me how do you include the header stddef.h? Just add #include . and no need to copy a specific header in the sod folder. /Javier On Wednesday, November 13, 2019 at 11:49:16 AM UTC-3, Larry Rix wrote: > > Hey Javier, >
  • Nov 13
    Re: [eiffel-users] Re: WrapC VS SOD
    Are you on Slack? If so, perhaps we can take this interaction there and just report the solution here.
  • Nov 13
    Re: [eiffel-users] Re: WrapC VS SOD
    Hey Javier, It has been way too long ago that I touched C/C++. Can you see what's wrong with it? [image: image.png]
  • Nov 13
    Why is LINKED_SET unable to compare objects?

    As I'd like to know if some object is into a LINKED_SET to prune it in my context, I'm unable to compare it as an object instead of its reference.

    changeable_comparison_criterion: BOOLEAN
            -- May `object_comparison' be changed?
            -- (Answer: only if set empty; otherwise insertions might
            -- introduce duplicates, destroying the set property.)
        do
            Result := is_empty
        ensure then
            only_on_empty: Result = is_empty
        end
    

    Into the SET class (as above) it seems that its not possible to change a set to compare_objects. So my questions are:

    1. What is the semantic of not being able to compare objects into a SET
    2. If my choice of LINKED_SET is wrong by misunderstanding of its semantic, how should I do for having a unique items collection based on object comparison and then being able to prune an item again based on object comparison again
  • Nov 12
    Re: WrapC VS SOD
    Excellent!
  • Nov 12
    Re: WrapC VS SOD
    The library Lib SOD is written in C99, On windows when we use VisualStudio in C mode, it follows the C standard from 1990, and WrapC uses the visual studio preprocessor and unfortunatelly it does not support C99. In this particular case the issue is in callback definition the parameter size_t
  • Nov 12
    Re: [eiffel-users] Re: WrapC VS SOD
    Is there a particular version of I ought to use? [image: image.png]
  • See more ...